Hello,
I have a 'txtfieldA', and a 'ListBoxA' which is supposed to be linked to 'tableA'.
tableA has the following fields: PatientID, PLName, PFName.
Now as I type in the txtfieldA the person's last name I want that record to show up on the 'ListBoxA'.
Example:
If I have 3 Smiths on my table (SmithA, SmithB, and SmithC), when I type 'Smi' (or 'S', or 'Sm') on 'txtfieldA', the three of them should pop up on 'ListBoxA' as I'm typing the matching characters.
So far I have the following code on the "On Key Press" event of 'txtfieldA', and it's not responding:
Me.ListBoxA.RowSource = "SELECT [tPatients].[PatientID], [tPatients].[PLName] & ', ' & [tPatients].[PFName], [tPatients].[PHomePhone] FROM [tPatients] ORDER BY [PLName], [PFName] WHERE [tPatients].[PLName] LIKE [Forms]![Main]![txtfieldA];"
Me.ListBoxA.Requery
Can someone give me a hand on this one?
Thank you everyone
I have a 'txtfieldA', and a 'ListBoxA' which is supposed to be linked to 'tableA'.
tableA has the following fields: PatientID, PLName, PFName.
Now as I type in the txtfieldA the person's last name I want that record to show up on the 'ListBoxA'.
Example:
If I have 3 Smiths on my table (SmithA, SmithB, and SmithC), when I type 'Smi' (or 'S', or 'Sm') on 'txtfieldA', the three of them should pop up on 'ListBoxA' as I'm typing the matching characters.
So far I have the following code on the "On Key Press" event of 'txtfieldA', and it's not responding:
Me.ListBoxA.RowSource = "SELECT [tPatients].[PatientID], [tPatients].[PLName] & ', ' & [tPatients].[PFName], [tPatients].[PHomePhone] FROM [tPatients] ORDER BY [PLName], [PFName] WHERE [tPatients].[PLName] LIKE [Forms]![Main]![txtfieldA];"
Me.ListBoxA.Requery
Can someone give me a hand on this one?
Thank you everyone