Hi,
I have two combo boxes on a search form. one that has a list of the subject IDs and the other that has a list of forms.
After the user choses the subject ID and then the form, I want the form to open to the record of the Subjct ID chosen.
I have the following code on the click event of the second combo box, the one that lists the forms but it isn't working. After a form is chosen from the list, a message diolog box pops up saying "The action or method requires a Form Name argument"
Any advise you could give would be great. Thanks!
<code>
Private Sub ComboFormList_Click()
On Error GoTo Err_ComboFormList_Click
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Search
Case "frmPersonalInfo"
stDocName = "frmPersonalInfo"
Case "frmOrder"
stDocName = "frmOrder"
End Select
stLinkCriteria = "[SubID]=" & Me![SubID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ComboFormList_Click:
Exit Sub
Err_ComboFormList_Click:
MsgBox Err.Description
Resume Exit_ComboFormList_Click
End Sub
</code>
I have two combo boxes on a search form. one that has a list of the subject IDs and the other that has a list of forms.
After the user choses the subject ID and then the form, I want the form to open to the record of the Subjct ID chosen.
I have the following code on the click event of the second combo box, the one that lists the forms but it isn't working. After a form is chosen from the list, a message diolog box pops up saying "The action or method requires a Form Name argument"
Any advise you could give would be great. Thanks!
<code>
Private Sub ComboFormList_Click()
On Error GoTo Err_ComboFormList_Click
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Search
Case "frmPersonalInfo"
stDocName = "frmPersonalInfo"
Case "frmOrder"
stDocName = "frmOrder"
End Select
stLinkCriteria = "[SubID]=" & Me![SubID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ComboFormList_Click:
Exit Sub
Err_ComboFormList_Click:
MsgBox Err.Description
Resume Exit_ComboFormList_Click
End Sub
</code>