Sam Summers
Registered User.
- Local time
- Today, 04:07
- Joined
- Sep 17, 2001
- Messages
- 939
Hi again,
I'm trying to open a form from a button with the following code but getting the error as attached
'SetArea' is an integer 1 to 5 and is a combobox
I'm guessing there is something wrong with my LinkCriteria statement?
Thank you in advance
I'm trying to open a form from a button with the following code but getting the error as attached
Code:
Private Sub TOEnterByAreaBtn_Click()
On Error GoTo TOEnterByAreaBtn_Click_Err
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(SelectArea) Then
DoCmd.Beep
MsgBox "You must select an Area first.", vbExclamation, "No Area selected!"
End
End If
ClientName.SetFocus
stLinkCriteria = "[SetArea]=" & Me![SelectArea] & " And [ReportNumber] = " & Me![ReportNo]
If Forms!Main!ClientName = "TRA" Then
stDocName = "EnterItemTransocean"
Else
stDocName = "EnterItemDROPS"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
TOEnterByAreaBtn_Click_Exit:
Exit Sub
TOEnterByAreaBtn_Click_Err:
MsgBox Error$
Resume TOEnterByAreaBtn_Click_Exit
End Sub
'SetArea' is an integer 1 to 5 and is a combobox
I'm guessing there is something wrong with my LinkCriteria statement?
Thank you in advance