Hello, I have two list boxes; the first one has First Names and the second list box has Last Names. I want the user to be able to select the first and last name from each text box and a Report will be generated. I wrote the code below, but it does not work. Can someone halp me to figure this out. I need it badly.
THank you in advance.
[code=vb]
Private Sub cmdName_Click()
Dim pstCriteria As String
If IsFirst([LstLastName]) And IsLast([LstFirstName]) Then
pstrCriteria = "[LastName] >= # " & [FirstName] & "# and [FirstName]<=#" & [LastName] & "#"
DoCmd.OpenReport "rptName", acViewPreview, , pstrCriteria
End If
[/End]