If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Populating a field Automatically
Hello, I am in the process of setting up a project database in access and
need some help. I have set up 2 tables linked through the site id. One table holds the project info and the other lists the site id and site name. (1 to many) What I'm trying to do is get the database to automatically populate the site name based on the user inputing the site ID. Currently one field is updated via a form with a drop down list of site numbers (5 digit code). So in the form once the site id is selected I what the form to automatically input the relating site name. If you could please offer some advice. Kind Regards -- Andrea Stimson Technical Administrator |
#2
|
|||
|
|||
Populating a field Automatically
What you would normally do is set up a search. You could enter siteID and
the information about site ID would then be populated. To do that, put a combo box on the form. Allow the combo box wizard to do that for you, specifying your site ID as the source (the wizard will ask you.) The right click on the combo box, go to properties, go to the event property, and click the little button out to the right of the Afterupdate event. When it asks you what you want to do, enter start the code builder. Type this in: Me.filter = "[siteid] = """ & Me.combo# & """" Me.filteron = true The combo box number will be listed there, like combo12 or combo34. "Andrea Stimson" wrote: Hello, I am in the process of setting up a project database in access and need some help. I have set up 2 tables linked through the site id. One table holds the project info and the other lists the site id and site name. (1 to many) What I'm trying to do is get the database to automatically populate the site name based on the user inputing the site ID. Currently one field is updated via a form with a drop down list of site numbers (5 digit code). So in the form once the site id is selected I what the form to automatically input the relating site name. If you could please offer some advice. Kind Regards -- Andrea Stimson Technical Administrator |
#3
|
|||
|
|||
Populating a field Automatically
Thanks, this is really helpfull and has worked however I have one question
linked to this. I need the info from the combo box to update the field called "Final site name" in the main project table so I can use the data for reporting. currently it's not linked. If you could please offer some advise. Thanks Andrea -- Andrea Stimson Technical Administrator "Golfinray" wrote: What you would normally do is set up a search. You could enter siteID and the information about site ID would then be populated. To do that, put a combo box on the form. Allow the combo box wizard to do that for you, specifying your site ID as the source (the wizard will ask you.) The right click on the combo box, go to properties, go to the event property, and click the little button out to the right of the Afterupdate event. When it asks you what you want to do, enter start the code builder. Type this in: Me.filter = "[siteid] = """ & Me.combo# & """" Me.filteron = true The combo box number will be listed there, like combo12 or combo34. "Andrea Stimson" wrote: Hello, I am in the process of setting up a project database in access and need some help. I have set up 2 tables linked through the site id. One table holds the project info and the other lists the site id and site name. (1 to many) What I'm trying to do is get the database to automatically populate the site name based on the user inputing the site ID. Currently one field is updated via a form with a drop down list of site numbers (5 digit code). So in the form once the site id is selected I what the form to automatically input the relating site name. If you could please offer some advice. Kind Regards -- Andrea Stimson Technical Administrator |
Thread Tools | |
Display Modes | |
|
|