MrRichDean
Technical User
Ok, form question for you.
I have a form that uses several buttons that when clicked, will send the user to a new form. Fine, lovely stuff. What I would like to do, is set up the on click so that it takes one of the fields on the current record on the one form into account and uses this as a reference to go to the second form.
So for example, I have Form 1 featuring client ID, client name, staff member as fields. On Form 2, I have staff member, address, telephone number.
If I click on the button in Form 1, in this case, staff details, this would take the user to Form 2 but focus on look at the staff member currently present in Form 1.
Currently the syntax is this:
Private Sub Current_Staff_Detail_Click()
On Error GoTo Err_Current_Staff_Detail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "tblIndividualStaff"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Current_Staff_Detail_Click:
Exit Sub
Err_Current_Staff_Detail_Click:
MsgBox Err.Description
Resume Exit_Current_Staff_Detail_Click
End Sub
I strongly suspect I have to insert an "On Current" focus or something like that but being a bit thick, I 'm npot sure how to proceed.
If anyone can assist me in this, I will be extremely grateful
Rich
I have a form that uses several buttons that when clicked, will send the user to a new form. Fine, lovely stuff. What I would like to do, is set up the on click so that it takes one of the fields on the current record on the one form into account and uses this as a reference to go to the second form.
So for example, I have Form 1 featuring client ID, client name, staff member as fields. On Form 2, I have staff member, address, telephone number.
If I click on the button in Form 1, in this case, staff details, this would take the user to Form 2 but focus on look at the staff member currently present in Form 1.
Currently the syntax is this:
Private Sub Current_Staff_Detail_Click()
On Error GoTo Err_Current_Staff_Detail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "tblIndividualStaff"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Current_Staff_Detail_Click:
Exit Sub
Err_Current_Staff_Detail_Click:
MsgBox Err.Description
Resume Exit_Current_Staff_Detail_Click
End Sub
I strongly suspect I have to insert an "On Current" focus or something like that but being a bit thick, I 'm npot sure how to proceed.
If anyone can assist me in this, I will be extremely grateful
Rich