Populating a field Automatically

A

Andrea Stimson

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
 
G

Golfinray

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.
 
A

Andrea Stimson

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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top