G
Guest
Hi all,
I got a [Combo709] on my [Main] form with some values ("A", "B", "C", etc.)
which i want to use to open different forms. The forms names are: "F_A",
"F_B", "F_C", etc.
I was trying to make a button for this, but when I click it, I get a message
"The action or method requires a Form Name argument".
I am not really good at writing codes - can somebody show me what is wrong
here?
Here is the code for my button:
Private Sub Command707_Click()
On Error GoTo Err_Command707_Click
Dim stDocName As String
Dim stLinkCriteria As String
If Me.Combo709 = "A" Then
stDocName = "F_A"
ElseIf Me.Combo709 = "B" Then
stDocName = "F_B"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command707_Click:
Exit Sub
Err_Command707_Click:
MsgBox Err.Description
Resume Exit_Command707_Click
End Sub
Your help will be very much appreciated.
Lana
I got a [Combo709] on my [Main] form with some values ("A", "B", "C", etc.)
which i want to use to open different forms. The forms names are: "F_A",
"F_B", "F_C", etc.
I was trying to make a button for this, but when I click it, I get a message
"The action or method requires a Form Name argument".
I am not really good at writing codes - can somebody show me what is wrong
here?
Here is the code for my button:
Private Sub Command707_Click()
On Error GoTo Err_Command707_Click
Dim stDocName As String
Dim stLinkCriteria As String
If Me.Combo709 = "A" Then
stDocName = "F_A"
ElseIf Me.Combo709 = "B" Then
stDocName = "F_B"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command707_Click:
Exit Sub
Err_Command707_Click:
MsgBox Err.Description
Resume Exit_Command707_Click
End Sub
Your help will be very much appreciated.
Lana