B
BrettS
I am currently using the following code for a button to go from one form to
the other, while remaining on the same Job #:
Private Sub OpenFile_Click()
On Error GoTo Err_OpenFile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FileData"
stLinkCriteria = "[RE Job #]=" & "'" & Me![RE Job #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenFile_Click:
Exit Sub
Err_OpenFile_Click:
MsgBox Err.Description
Resume Exit_OpenFile_Click
End Sub
I would like to do the same thing, only with not only with[RE Job #],
[Sample #] matching Me![Sample #], but I can't seem to figure out the syntax
to get it to work correctly. Something like:
Private Sub OpenFile_Click()
On Error GoTo Err_OpenFile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FileData"
stLinkCriteria = "[RE Job #]=" & "'" & Me![RE Job #] & "'" and "[Sample
#]=" & "'" & Me![Sample #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenFile_Click:
Exit Sub
Err_OpenFile_Click:
MsgBox Err.Description
Resume Exit_OpenFile_Click
End Sub
However, when I try this I get a "Type mismatch" error message. Anything
thanks would be appreciated.
the other, while remaining on the same Job #:
Private Sub OpenFile_Click()
On Error GoTo Err_OpenFile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FileData"
stLinkCriteria = "[RE Job #]=" & "'" & Me![RE Job #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenFile_Click:
Exit Sub
Err_OpenFile_Click:
MsgBox Err.Description
Resume Exit_OpenFile_Click
End Sub
I would like to do the same thing, only with not only with[RE Job #],
[Sample #] matching Me![Sample #], but I can't seem to figure out the syntax
to get it to work correctly. Something like:
Private Sub OpenFile_Click()
On Error GoTo Err_OpenFile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FileData"
stLinkCriteria = "[RE Job #]=" & "'" & Me![RE Job #] & "'" and "[Sample
#]=" & "'" & Me![Sample #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenFile_Click:
Exit Sub
Err_OpenFile_Click:
MsgBox Err.Description
Resume Exit_OpenFile_Click
End Sub
However, when I try this I get a "Type mismatch" error message. Anything
thanks would be appreciated.