J
Jan Il
Hi All - Access 2002XP - Win XP Pro
I have the code below behind a button on a filter form to check the various
combo boxes for data and then open the record form to display the
information accordingly. I am getting the following error when I click the
button.
"Microsoft Access can't find the filed cmbReservations referred to in your
expression."
I have checked the field on record form and it is Reservations, the control
on the filter form is cmbReservations. So, I am confused as to where the
error is stemming from. All the others are working without errors.
***********************Start Code**********************
Private Sub cmdExpResearch_Click()
On Error GoTo Err_cmdExpResearch_Click
Dim strWhere As String
Dim stDocName As String
Dim stLinkCriteria As String
strWhere = ""
' do EventName
If IsNull(Me!cmbEventName) = False Then
strWhere = "[EventName]=" & """" & Me![cmbEventName] & """"
End If
Me![cmbEventName] = Null
' do Location
If IsNull(Me!cmbEventLocation) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[EventLocation]=" & "'" & Me![cmbEventLocation] &
"'"
End If
Me![cmbEventLocation] = Null
' do RSVPs
If IsNull(Me!cmbEventRSVPs) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[EventRSVPs]=" & "'" & Me![cmbEventRSVPs] & "'"
End If
Me![cmbEventRSVPs] = Null
' do Reservations
If IsNull(Me!cmbReservations) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[Reservations]=" & "'" & Me![cmbReservations] &
"'"
End If
Me![cmbReservations] = Null
stDocName = "frmEventsRegister"
stLinkCriteria = strWhere
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdExpResearch_Click:
Exit Sub
Err_cmdExpResearch_Click:
MsgBox Err.Description
Resume Exit_cmdExpResearch_Click
End Sub
********************End Code*************
I would really appreciate it if somone would give some input as to where I
might look to troubleshoot this error further. Obviously, I am missing
something somewhere.
Jan
MS MVP - IE/OE
Smiles are meant to be shared,
that's why they're so contagious.
I have the code below behind a button on a filter form to check the various
combo boxes for data and then open the record form to display the
information accordingly. I am getting the following error when I click the
button.
"Microsoft Access can't find the filed cmbReservations referred to in your
expression."
I have checked the field on record form and it is Reservations, the control
on the filter form is cmbReservations. So, I am confused as to where the
error is stemming from. All the others are working without errors.
***********************Start Code**********************
Private Sub cmdExpResearch_Click()
On Error GoTo Err_cmdExpResearch_Click
Dim strWhere As String
Dim stDocName As String
Dim stLinkCriteria As String
strWhere = ""
' do EventName
If IsNull(Me!cmbEventName) = False Then
strWhere = "[EventName]=" & """" & Me![cmbEventName] & """"
End If
Me![cmbEventName] = Null
' do Location
If IsNull(Me!cmbEventLocation) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[EventLocation]=" & "'" & Me![cmbEventLocation] &
"'"
End If
Me![cmbEventLocation] = Null
' do RSVPs
If IsNull(Me!cmbEventRSVPs) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[EventRSVPs]=" & "'" & Me![cmbEventRSVPs] & "'"
End If
Me![cmbEventRSVPs] = Null
' do Reservations
If IsNull(Me!cmbReservations) = False Then
If strWhere <> "" Then strWhere = strWhere & " and "
strWhere = strWhere & "[Reservations]=" & "'" & Me![cmbReservations] &
"'"
End If
Me![cmbReservations] = Null
stDocName = "frmEventsRegister"
stLinkCriteria = strWhere
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdExpResearch_Click:
Exit Sub
Err_cmdExpResearch_Click:
MsgBox Err.Description
Resume Exit_cmdExpResearch_Click
End Sub
********************End Code*************
I would really appreciate it if somone would give some input as to where I
might look to troubleshoot this error further. Obviously, I am missing
something somewhere.
Jan
MS MVP - IE/OE
Smiles are meant to be shared,
that's why they're so contagious.