AlfonsoPina
asked on
Microsoft Access Forms
I need to learn a simple task. I have a form that enables me to enter users into a database. I enter into fields: "username", "Lname", "Fname", etc. I would like to be able to search through previously entered Last names (Lname) to edit users. if I put in record 32 John Doe, and later when I'm on record 100 or so, I want to be able to simply click a dropdown in "Lname" and searvh for Doe and find any and all records with that last name. possibly I might do it with the username instead but you get my drift.
ASKER
Ok, this gave me the ability to select a username from the list but it kept the same record I'm working on . for instance:
Username: John.doe
Lname: Doe
Fname: John
after selecting a different username from the list i get the same record but with the new username
UserName: jane.doe
Lname: Doe
Fname: John
so it didn't select the whole record for the username I'm looking for it simply changed the username of the current record. it is close though
Username: John.doe
Lname: Doe
Fname: John
after selecting a different username from the list i get the same record but with the new username
UserName: jane.doe
Lname: Doe
Fname: John
so it didn't select the whole record for the username I'm looking for it simply changed the username of the current record. it is close though
I would assume that's not the same record, but rather the record associated with jane.doe (since they have the same LName value, but "Jane" comes before "John").
If you want to find the jane.doe record, you'd have to change the Filter to point to the correct one. I'd assume you'd want to filter for UserName instead of LName.
If you want to find the jane.doe record, you'd have to change the Filter to point to the correct one. I'd assume you'd want to filter for UserName instead of LName.
ASKER
Yes, sorry, I forgot to respond since I've been traveling. I changed it to username because of other associations. Those were two different records. If I'm working on record two and for some reason I need to review the first record, I would like to select it from a drop-down. I dont want to select the name and it simply change the username for the rexord I'm currently editing. I want it to select and open that record. But that may be asking a bit much now that I think about it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm going to try that right now, let you know shortly how it comes out.
1. Add a Combobox to your form. Do NOT set a ControlSource for that combo
2. Set the Combos Rowsource like this: "SELECT DISTINCT LName FROM YourTable"
3. In the AfterUpdate event of your Combo:
Me.Filter = "Lname = '" & Me.YourCombo.Column(0) & "'"
Me.FilterOn = True