Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List/Combo box question

Status
Not open for further replies.

jasonsas

Technical User
Oct 2, 2002
63
AU
Hi,

I am new to access and am building a small database. I have created a form which I would like to create a combo/list box for a field. I would like this field to only contain certain values and then depending on what a user chooses, for that value to populate the field in the corresponding table.

Can anyone point me in the right direction?

Thanks!
 
Your question seems a little vague but if you want to set the value in a field on the same form or another, you can do it on the AfterUpdate event of the combo using the following code:

Me.Field1 = Me.Combo

Where Field1 is the field you want to update. If the field is on another form, you have to put the full reference in like so:

Forms!FormName!Field1 = Me.Combo

Where FormName is the name of the form containing the field you want to update.

If you want to update a table, then you can use an update query that is filtered by a criterion on the form whose value you are referencing
 
Hi Barry,

Thanks for replying. HOpefully I can clarify my answer for you. I have a field ona form which I would like users to only select certain values from (eg, low, medium, high), rather than them being able to type in their own values. Where would I set these values (on the form or in the corresponding table)?

thanks for your help
 
Jasonsas,

a) You need to create a table for (low, med etc...)
b) Then create a select query to link this table with other tables with a common linked field.
c) From your design form - selct this query as your source and select this field
d) Under the Data Tab in field properties:
Row Source Type: Table/Query
Row Source: your lookup table name

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top