G
Guest
Hi,
I have a list box that shows "company names" and their "work type"
(plumbing, electrical, etc.). My problem is that I have some companies that
are listed under more than one work type and when I select a company name I
get all of the work types for that company name. How do I specifically select
a company name with only that specific work type? I copied my code below.
Thanks,
Jim
Private Sub BtnJobs_Click()
On Error GoTo Err_BtnJobs_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Sub List (Alpha by Company Name)1"
If Not IsNull(Me.LstJobNo) Then
stLinkCriteria = "[Company]=""" & Me.LstJobNo & """"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.LstJobNo
Else
DoCmd.OpenForm stDocName
End If
Exit_BtnJobs_Click:
Exit Sub
Err_BtnJobs_Click:
MsgBox Err.Description
Resume Exit_BtnJobs_Click
End Sub
I have a list box that shows "company names" and their "work type"
(plumbing, electrical, etc.). My problem is that I have some companies that
are listed under more than one work type and when I select a company name I
get all of the work types for that company name. How do I specifically select
a company name with only that specific work type? I copied my code below.
Thanks,
Jim
Private Sub BtnJobs_Click()
On Error GoTo Err_BtnJobs_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Sub List (Alpha by Company Name)1"
If Not IsNull(Me.LstJobNo) Then
stLinkCriteria = "[Company]=""" & Me.LstJobNo & """"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.LstJobNo
Else
DoCmd.OpenForm stDocName
End If
Exit_BtnJobs_Click:
Exit Sub
Err_BtnJobs_Click:
MsgBox Err.Description
Resume Exit_BtnJobs_Click
End Sub