J
Johnny Bright
I'm trying to change a form's recordsource depending on whether or not a text
box on my lookup form is filled in. The two different queries use different
parameters but for some reason, the form will only look at the first query,
the one I have set as the form's datasource.
Private Sub Form_Open(Cancel As Integer)
If Forms!frmLookup.txtPatient.Value = "" Then
Me.RecordSource = "qryPatientsFilter"
Else
Me.RecordSource = "qryPatientsFilterLast"
End If
End Sub
What am I doing wrong?
Thanks
J
box on my lookup form is filled in. The two different queries use different
parameters but for some reason, the form will only look at the first query,
the one I have set as the form's datasource.
Private Sub Form_Open(Cancel As Integer)
If Forms!frmLookup.txtPatient.Value = "" Then
Me.RecordSource = "qryPatientsFilter"
Else
Me.RecordSource = "qryPatientsFilterLast"
End If
End Sub
What am I doing wrong?
Thanks
J