G
Guest
Hi,
I have a command button that opens another form and filters the information
based on a job number and "FCN" Number. Due to various billing amounts by
the same contractor on the same job, I have added a suffix to the job number.
ie. 25168, 25168C,25168SF.
I have the following code:
Private Sub cmdViewTickets_Click()
On Error GoTo Err_cmdViewTickets_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EXTRA WORK TICKETS EDITfrm"
stLinkCriteria = "[FIELDWORKFCNNUM]=" & Me![FCNNUM] & "AND" &
"[FIELDWORKJOBNUM]=" & "'" & Me![FCNJOBNUM] & "*" & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewTickets_Click:
Exit Sub
Err_cmdViewTickets_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdViewTickets_Click
End Sub
The watch window shows that the value for stLinkCriteria is:
"[FIELDWORKFCNNUM]=1AND[FIELDWORKJOBNUM]='25168*'"
(25168 is the root job number)
The form opens blank. Why doesn't '25168*' return 25168SF or 25168C or 25168?
What can I do to get any record matching with these job numbers to be
diplayed in the form?
TIA
I have a command button that opens another form and filters the information
based on a job number and "FCN" Number. Due to various billing amounts by
the same contractor on the same job, I have added a suffix to the job number.
ie. 25168, 25168C,25168SF.
I have the following code:
Private Sub cmdViewTickets_Click()
On Error GoTo Err_cmdViewTickets_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EXTRA WORK TICKETS EDITfrm"
stLinkCriteria = "[FIELDWORKFCNNUM]=" & Me![FCNNUM] & "AND" &
"[FIELDWORKJOBNUM]=" & "'" & Me![FCNJOBNUM] & "*" & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewTickets_Click:
Exit Sub
Err_cmdViewTickets_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdViewTickets_Click
End Sub
The watch window shows that the value for stLinkCriteria is:
"[FIELDWORKFCNNUM]=1AND[FIELDWORKJOBNUM]='25168*'"
(25168 is the root job number)
The form opens blank. Why doesn't '25168*' return 25168SF or 25168C or 25168?
What can I do to get any record matching with these job numbers to be
diplayed in the form?
TIA