combo box default value

L

Lez

I have three combo boxes:

colours
sizes
other

These are filtered by a main combo cboProducts

I need to be able to get the first record in the combo box to show as a
default record, and if now values are available for the combo, to say 'none'
can anyone advise how to do this please?
 
M

Mr. B

Les,

You can take a look at the link belos that talks about adding "All" to a
combo box or list box. In your case you could just substitue "None" for "All"
http://www.mvps.org/access/forms/frm0043.htm

With that said, have you considered just setting the enabled property of the
combobox to No if it does not have any applicable values. This would be much
simpler to maintain and would still provide the user with some feedback.
-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 
L

Lez

Hi Mr B,

Can you explain the 'enable' property setting, as this would suit me better,
the other method the user could simply select the first option which migh be
incorrect.

Making the combo not enable if there is no value would be a better option.

Regards
Lez
 
M

Mr. B

The enable property is available form most controls. You can set this
property based on specific conditions.

You will need to use either a macro or some VBA code to set the property.

I prefer VBA code (just because I have been writing it for a long time) but
as I said, a macro will do what you want.

Each of your combo boxes has several events. Select your "cboProducts"
combo box by just clicking on it. Display the Properites for this control.
The way to do this varies by which version of Access you are using. I did
not see any indication of your version.

I would suggest that you try creating a macro to enable or disable your one
of your other controls from the AfterUpdate event based on whether or not
that other control has any records in it.

Not knowing anything about your data I cannot give you much more detailed
advice.

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 

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