G
Guest
I posted a similiar question friday but didn't want to respond to it in fear of no one checking it. So I am reposting a better question?
I am trying to pass a paramater from one form to another's record source. The second form (receiving the paramater) is built using the record source property in the QBE grid.
When data is inputted into a text box an After Update event is triggered and the VBA creates a string to a hidden text box on the form.
Here is the code I use to assign the string to the text box
Private Sub JobName_AfterUpdate()
If IsNull(Me.JobName) Then
'Me.txtJobName = "Like " & Chr(34) & "*" & Chr(34) & " " & "Or j_JobName Is Null"
Me.txtJobName = "Like [Forms]![SearchForm]![txtJobName] Or Is Null"
Else
Me.txtJobName = "*" & Me.JobName & "*"
End If
End Sub
The string in the text box is Like "*" Or Is Null So when Like "*" or Is Null is passed to form1 record source I get no results. But if I copy Like "*" Or is Null to the receiving form in the criteria box in the QBE grid of the record source it works just fine.
How does Access read this string and how can I pass it so Access can understand it.
Also, I noticed if I put Like in the criteria box and pass * then I get all the results but if I pall Like * then I get nothing. Please help me understand!
Thanks
If you need more information please let me know.
I am trying to pass a paramater from one form to another's record source. The second form (receiving the paramater) is built using the record source property in the QBE grid.
When data is inputted into a text box an After Update event is triggered and the VBA creates a string to a hidden text box on the form.
Here is the code I use to assign the string to the text box
Private Sub JobName_AfterUpdate()
If IsNull(Me.JobName) Then
'Me.txtJobName = "Like " & Chr(34) & "*" & Chr(34) & " " & "Or j_JobName Is Null"
Me.txtJobName = "Like [Forms]![SearchForm]![txtJobName] Or Is Null"
Else
Me.txtJobName = "*" & Me.JobName & "*"
End If
End Sub
The string in the text box is Like "*" Or Is Null So when Like "*" or Is Null is passed to form1 record source I get no results. But if I copy Like "*" Or is Null to the receiving form in the criteria box in the QBE grid of the record source it works just fine.
How does Access read this string and how can I pass it so Access can understand it.
Also, I noticed if I put Like in the criteria box and pass * then I get all the results but if I pall Like * then I get nothing. Please help me understand!
Thanks
If you need more information please let me know.