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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalskedar
    New Member
    • Sep 2009
    • 66

    #1

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

    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....
    Code:
    If Combo="Sliding Door" then
    Combo="SD"
    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...
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    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

    Comment

    Working...