A
Access Greenhorn
I would like to do a case statement, like the one below
Private Sub cboPersonID_BeforeUpdate(Cancel As Integer)
Select Case grpSelect.Value
Case 1
Me.cboItems.RowSource = "SELECT blah blah ORDER ON First Name;"
Case 2
Me.cboItems.RowSource = "SELECT blah blah ORDER ON Last Name;"
End Select
Exit Sub
but I don't know how to convert my query SQL statement to a VBA SQL
statement. Could someone pls convert or show me how to convert the following
statement?
SELECT tblPersonnel.PersonID, tblPersonnel.FirstName, tblPersonnel.LastName,
tblLabs.City
FROM tblLabs RIGHT JOIN (tblPersonnel LEFT JOIN tblCertification ON
tblPersonnel.PersonID = tblCertification.PersonID) ON tblLabs.LabCode =
tblPersonnel.LabCode
WHERE (((tblPersonnel.Postion) Like '*Technician*'))
ORDER BY tblPersonnel.LastName;
Thanks,
AG
Private Sub cboPersonID_BeforeUpdate(Cancel As Integer)
Select Case grpSelect.Value
Case 1
Me.cboItems.RowSource = "SELECT blah blah ORDER ON First Name;"
Case 2
Me.cboItems.RowSource = "SELECT blah blah ORDER ON Last Name;"
End Select
Exit Sub
but I don't know how to convert my query SQL statement to a VBA SQL
statement. Could someone pls convert or show me how to convert the following
statement?
SELECT tblPersonnel.PersonID, tblPersonnel.FirstName, tblPersonnel.LastName,
tblLabs.City
FROM tblLabs RIGHT JOIN (tblPersonnel LEFT JOIN tblCertification ON
tblPersonnel.PersonID = tblCertification.PersonID) ON tblLabs.LabCode =
tblPersonnel.LabCode
WHERE (((tblPersonnel.Postion) Like '*Technician*'))
ORDER BY tblPersonnel.LastName;
Thanks,
AG