Tables question...

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi,

I have a (hopefully) quick question for the experienced...

I have a table of categories. On my form I want certain category values to
bring up a list box of sub-categories, or if there is no corresponding table
of sub-categories to allow text to be entered - but not either/or.

What's the best way to set this up??

regards,

Ben Yamin
 
On your form:

Add a ComboBox that displays all the Categories. Make
sure the LimitToList property is set to Yes. (This means
the user cannot enter a value not in the list).

Add a ListBox and make its data source a query that
selects the sub-categories for the category specified in
the ComboBox on the form.

Add a TextBox and set the Enabled property to No.

In the OnChange event for the ComboBox, either requery the
ListBox or enable the TextBox, depending on the value
selected. You can do it with code or a macro, depending
on which you're more comfortable with. Using code, I
would use the Select Case statement on the value in the
Category ComboBox. Using a macro, I would set conditions,
also based on the values in the ComboBox.

Hope this helps!

Howard Brody
 
Back
Top