default value

M

mark r

how would I make combobox2 take on the value of combox1 as soon as
combobox1 is populated, but thereafter never take on a value of combobox 1
should somjeone change it Of course, I still want combox2 to retain its drop
down and changeable functionality
 
M

MikeC

Mark,

In the *after update* event procedure for combobox1, enter
the below code:

With Me
If IsNull(!combox2) And Not IsNull(!combobox1) Then
!combox2 = !combobox1
End If
End With

Also worth noting is that the above functionality will not
behave as a true default would. A true default would
populate combox2 when the new record is initially inserted.

The above functionality will update combox2, for an
*existing* record, each time combobox1 is updated if the
above conditions are true. Therefore, if a user decides
to remove the contents of combox2 from an existing record
and then modifies combobox1 to a non-null value, then
combox2 will be re-populated. One way to prevent this
situation could be to set combox2's "Validation Rule"
property = "Is Not Null".
 
M

mark r

thanks, I will go try that.

In the meantime, it sounds to me like you are
knowledgeable about combo boxes and I have another
combobox "challenge" that someone else couldn't understand.

Would you give it a look?

I am trying to get one combobox to update two different
fields in two different tables:
 

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