reidgivens
Technical User
I am very novice with access.
I am trying to create a search type of form, that when fillout out and clicked will take the user to a list of results. So far so good, i have this. The next part is, when they get to the list of results, I want them to click a button and go to the customers records form to view or edit.
My problem is each customer can have multiple entries in a sub form, and i need the button to take them to the right customer, and the right subform entry.
This is for a car shop. Each customer may have 2 or 3 cars, so how do you have it show up with the right car in the subform.
This is what i have so far.
--------------------------
Private Sub view_Click()
On Error GoTo Err_view_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "customers"
stLinkCriteria = "[c_id_num]=" & Me![c_id_num] & " AND [v_id_num]=" & Me![v_id_num]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_view_Click:
Exit Sub
Err_view_Click:
MsgBox Err.Description
Resume Exit_view_Click
End Sub
------------------------------------------
c_ic_num is the customers id and v_id_num is vehicle id
please help
I am trying to create a search type of form, that when fillout out and clicked will take the user to a list of results. So far so good, i have this. The next part is, when they get to the list of results, I want them to click a button and go to the customers records form to view or edit.
My problem is each customer can have multiple entries in a sub form, and i need the button to take them to the right customer, and the right subform entry.
This is for a car shop. Each customer may have 2 or 3 cars, so how do you have it show up with the right car in the subform.
This is what i have so far.
--------------------------
Private Sub view_Click()
On Error GoTo Err_view_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "customers"
stLinkCriteria = "[c_id_num]=" & Me![c_id_num] & " AND [v_id_num]=" & Me![v_id_num]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_view_Click:
Exit Sub
Err_view_Click:
MsgBox Err.Description
Resume Exit_view_Click
End Sub
------------------------------------------
c_ic_num is the customers id and v_id_num is vehicle id
please help