B
Brian
Hello all,
I have a popup modal form that I use to search with. It has an unbound
textbox on it. I have users fill in their record number, then I want
the popup to close and filter a subform on the page on the value passed
in the textbox. Here's my code, I'm having problems...
If txtRecordNumber.Value = "" Or txtRecordNumber.Value = 0 Then
'value was null, so tell user
DisplayMessage ("Some Arbitrary Error Message.")
Else
'test to make sure value is num
'set search criteria
Dim criteria As String
criteria = "[Recno]=" & Me!txtRecordNumber.Value
'send value back to form for filtering
Forms("mainFrame").subFormName.Form.Filter = criteria
Forms("mainFrame").subFormName.Form.FilterOn = True
'update the data in underlying form
Forms("mainFrame").sbfPrimaryElements.Form.Requery
'close the search form
DoCmd.Close acForm, "mySearch", acSaveNo
End If
criteria is ending up to be "[Recno]=", it's not accepting the value of
the textbox?
Can I get some assistance here?
I have a popup modal form that I use to search with. It has an unbound
textbox on it. I have users fill in their record number, then I want
the popup to close and filter a subform on the page on the value passed
in the textbox. Here's my code, I'm having problems...
If txtRecordNumber.Value = "" Or txtRecordNumber.Value = 0 Then
'value was null, so tell user
DisplayMessage ("Some Arbitrary Error Message.")
Else
'test to make sure value is num
'set search criteria
Dim criteria As String
criteria = "[Recno]=" & Me!txtRecordNumber.Value
'send value back to form for filtering
Forms("mainFrame").subFormName.Form.Filter = criteria
Forms("mainFrame").subFormName.Form.FilterOn = True
'update the data in underlying form
Forms("mainFrame").sbfPrimaryElements.Form.Requery
'close the search form
DoCmd.Close acForm, "mySearch", acSaveNo
End If
criteria is ending up to be "[Recno]=", it's not accepting the value of
the textbox?
Can I get some assistance here?