Please help me set up some Access forms.
August 5, 2009 1:41 PM
Subscribe
I have two questions about setting up MS Access forms:
1) Currently, I have a form to enter the volunteer id, shift start time and shift stop time, but the client doesn't want to have to look up the id in a report. Is there a way to create a selection list from the volunteer's names? What other options are there?
2) On the "add/edit a volunteer" form, I'd like to be able to choose tasks from a selection list. The tasks table has id and name. The "tasks of volunteers" join table has volunteer id and task id. How do I set this up? I can't seem to get the right combination of configurations.
Additional information:
1) The shifts table only has those three fields, and I don't want to make the volunteer's name a primary key.
2) I don't want to resort to adding the booleans TaskSort, TaskPrep, ..., to the volunteers table, since that's not how databases are supposed to be set up. When I try to use a select query, I get "SELECT ..." as one of my options.
* It's Access version 2003.
* I'm just using standard forms (ie. not "Pages").
* I'm pretty sure I've created the tables in a "best practices" way, but since I'm creating this database from scratch, I can create anything however I want.
* I think I know about database theory pretty well, and that's not what this question is about.
* But, I'm new to Access, so it's likely I'm missing something easy.
Thanks.
posted by philomathoholic to computers & internet (7 comments total)
SELECT Users.Name, Users.ID FROM Users;
Then use a combobox on your form with the rowsource to UserIDs (or whatever you named it). Set Column Count to 1 and Bound Column to 2 (Users.ID). Make sure you limit the selection of that combobox to the query to ensure that the user doesn't enter anything that isn't there. If they do try to add a user that doesn't exist, you can use the "Not In List" event to handle it (if you need help with that or some simple VBA, just ask). On a side note, you should definitely enforce referential equality (via the relationships view) between the User ID field in your tables. This will ensure that you never have a User ID that isn't in a User table.
I'm having a little trouble understanding your second question though, could you clarify what relevent what tables and forms you have? Are you trying to set up the selection box?
posted by vmrob at 2:05 PM on August 5