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

Can I change values for a Combo Box based on specific condition

P: 66
In my DB i need to change the value for a Combo Box based on some condition..
These values r retrieved from 1 of the tables(Glass)
My Query is in my form 1 of the Combo boxes display these values,but i need to change these values once the form is Loaded.

For Ex-If the Combo Box contains value as "Sliding door" it shud display the value in the Form as "SD".
Here for this if the table contains 10 such records as "Sliding Door",then for all the Records the new value displayed in the Formusing Combo Box shud be "SD".

Similarly if the table contains value as "Fixed",the actual value displayed in the Combo Box in the Form shud be "FP".

On which event do i need to write this code....
Expand|Select|Wrap|Line Numbers
  1. If Combo="Sliding Door" then
  2. Combo="SD"
  3. end if
In this code if i use for loop how do i refer to Total no of Records in the form.

Can anyone Plz help me on this...
Apr 15 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,489
If you set up the ComboBox in the first place to include columns for what you want to see and what value you want returned, then you simply display only the former, and set the Bound Column to the latter.

Access has been designed to make many of the more common requirements as easy as possible. The problem is that many people don't realise this and try to do it all the complicated way. I suggest you use the F1 key (Context-sensitive help) on the following attributes to get a better understanding of what can easily be done :
Row Source
Column Count
Column Widths
Bound Column
Apr 15 '10 #2

Post your reply

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