hello !
I've a form contain a search box (find_name) on the formheader
it work without problems with its recordsourse through this vba
Private Sub find_name_Change()
Dim ct As String * 1
Dim ss As String * 1
ct = """"
ss = "*"
Me.find_name.Tag = Me.find_name.Text
Me.RecordSource = "SELECT * FROM persons WHERE persons.[personName] = '" & "Keven" & "' and persons.job LIKE " & ct & ss & (Nz(Me.find_name.Tag)) & ss & ct & ""
If Me.RecordsetClone.RecordCount = 0 Then
Me.Detail.Visible = False
Me.RecordSource = ""
Else
Me.Detail.Visible = True
End If
Me.find_name = Me.find_name.Tag
Me.find_name.SetFocus
SendKeys "{f2}"
End Sub
the search form is opened through click buttons in other form (general) and this also work through
DoCmd.OpenForm "search", , , "[personName]= '" & "Keven" & " '"
but i want each button not only open on specific name in the search form but also search only in his own data in the search box (find_name) so,
how can i change recordsourse of the search box [find_name] in search form when i click the button in the general form .. i tried this code but doesn't work
Forms!search.find_name.RecordSource ="SELECT * FROM persons WHERE persons.[personName] = '" & "Keven" & "' and persons.job LIKE " & ct & ss & (Nz(find_name.Tag)) & ss & ct & ""
Can i find help!!
I've a form contain a search box (find_name) on the formheader
it work without problems with its recordsourse through this vba
Private Sub find_name_Change()
Dim ct As String * 1
Dim ss As String * 1
ct = """"
ss = "*"
Me.find_name.Tag = Me.find_name.Text
Me.RecordSource = "SELECT * FROM persons WHERE persons.[personName] = '" & "Keven" & "' and persons.job LIKE " & ct & ss & (Nz(Me.find_name.Tag)) & ss & ct & ""
If Me.RecordsetClone.RecordCount = 0 Then
Me.Detail.Visible = False
Me.RecordSource = ""
Else
Me.Detail.Visible = True
End If
Me.find_name = Me.find_name.Tag
Me.find_name.SetFocus
SendKeys "{f2}"
End Sub
the search form is opened through click buttons in other form (general) and this also work through
DoCmd.OpenForm "search", , , "[personName]= '" & "Keven" & " '"
but i want each button not only open on specific name in the search form but also search only in his own data in the search box (find_name) so,
how can i change recordsourse of the search box [find_name] in search form when i click the button in the general form .. i tried this code but doesn't work
Forms!search.find_name.RecordSource ="SELECT * FROM persons WHERE persons.[personName] = '" & "Keven" & "' and persons.job LIKE " & ct & ss & (Nz(find_name.Tag)) & ss & ct & ""
Can i find help!!