By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

How to populate two fields on combo box selection

P: 3
I want to populate two table fields on a selection of either combo box, list box or any option button.
For e.g. When I select 'YES' as an option I want to populate two fields in the table i.e. value=100 and score=200

I am new to MS Access. How do I accomplish this ?

Aug 9 '07 #1
Share this Question
Share on Google+
1 Reply

P: 37
Your easest bet is build an append query. Presumeing you don't want a direct link to the table. Its pretty straightforward, if you don't use a wizard. Choose where you want your information to come from based upon what result.
If you have your value stored somplace (like the second column of a combo box) you can have the builder reference it.
For example
Expr3: DateAdd('m',Forms!frmverification!txtField2,Forms! frmverification!txtField1)
This addes months to a date held in frmverification txtField2 to txtfield1 (which are text boxes) and that value can be appended somewhere else.

Its important to remember that to append a value you must change your query type to an append query (not a select query which comes standard). This helpfully asks you where it is going. If you need to use an expression don't forget to make sure totals are being shown and then choose expression.

After you get good at it you can choose in the after update properties to run an SQL (which you can steal amost always directly from your well build query). Just change to SQL view (from design veiw). Copy paste, (Format) and run with the docmd.runsql command.
Aug 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.