query results show in form

  • Thread starter Thread starter jenn
  • Start date Start date
J

jenn

three days, on a very simple (i'm sure) set up.

I have three tables...
Service/Client Registration (Client ID, Lastname, address) PK Client ID
Action Plan (multiple Action Plan to Client ID - PK ActionPlanID
Service_ALL(ServiceID, Action ID) PK ServiceID lists all the services in
seperate table
I have a data input form ready to go....however, I want to put in a control
at the top of the page that will allow me to query Client IDs by Lastname.
and will then show the lastname, client ID and all the Action Plans for that
client.

I am going around in circles and wonder if there is someone who can help me
out.
 
So you have a form that is bound to a *query* that contains all 3 tables.
Assuming this query includes the Lastname field, you could use the
AfterUpdate event procedure of the unbound text box to filter the form to
people who have that name.

Something like this:

Private Sub txtFilterLastname_AfterUpdate()
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False
If not IsNull(Me.txtFilterLastname) Then
strWhere = "LastName Like """ & Me.txtFilterLastname & "*"""
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
 
Back
Top