Effing Access combo boxes, how do they work?
July 8, 2010 7:39 AM Subscribe
I'm trying to make a combo box populate properly in an MS Access form (oh, the pain), and I need some help.
New job has asked me to whup up a quick Access database to help them track some data for medical practices we visit. I am very unfamiliar with Access, and I'm having the following problem:
I have a table full of practice data. One of the fields is a numeric field that holds a unique ID for that practice's primary contact. That ID and relevant information are stored in a staff table. Each staff record also stores the ID number for that practice.
I've got the tables done, and a form for adding/editing data for each practice mostly done, but that primary contact field is screwing me up. I'm trying to make it be a combo box that drops down to reveal only those records from the staff table that have the current record's practice ID, but it's giving me all of them. I'd like it to show the staff member's last name and first name, and then feed that person's staff ID to the table.
I tried setting Row Source to be an SQL statement that joins the staff table to the practice table, but I can't figure out how to feed it the current record's practice ID automatically.
If coding is needed here, I'm a programmer with no VB knowledge, but so far I've had no trouble banging out code by googling syntax.
New job has asked me to whup up a quick Access database to help them track some data for medical practices we visit. I am very unfamiliar with Access, and I'm having the following problem:
I have a table full of practice data. One of the fields is a numeric field that holds a unique ID for that practice's primary contact. That ID and relevant information are stored in a staff table. Each staff record also stores the ID number for that practice.
I've got the tables done, and a form for adding/editing data for each practice mostly done, but that primary contact field is screwing me up. I'm trying to make it be a combo box that drops down to reveal only those records from the staff table that have the current record's practice ID, but it's giving me all of them. I'd like it to show the staff member's last name and first name, and then feed that person's staff ID to the table.
I tried setting Row Source to be an SQL statement that joins the staff table to the practice table, but I can't figure out how to feed it the current record's practice ID automatically.
If coding is needed here, I'm a programmer with no VB knowledge, but so far I've had no trouble banging out code by googling syntax.
Response by poster: Yes, I did know about relationships, and I just realized that I have a relationship defined, but not on that field. That plus a right join fixed it. Thanks!
posted by middleclasstool at 8:20 AM on July 8, 2010
posted by middleclasstool at 8:20 AM on July 8, 2010
« Older Does having hundreds of domain names effectively... | How can I make my cheeks less big? Newer »
This thread is closed to new comments.
Also, if you could post a URL to a copy of the database (with just some sample data) that would allow others to see what you've done to date, to help you figure it out.
posted by MikeWarot at 8:16 AM on July 8, 2010