Help with ComboBoxes

KingRudeDog

Registered User.
Local time
Today, 10:10
Joined
May 12, 2006
Messages
36
I have a form...formatted as a datasheet...with a combobox (cboMaterials_fk)that allows the user to add more then one material per item (in other words the user can define that the item is made up of several materials, after each choice a new line item appears (*) so an additional material can be added.

Ive used this tool from a previous db I built.

I'm wondering is there anyway to limit the combobox to a single choice without rebuilding the tables. Perhaps a property or something?

Let me clarify that:

So in the end, the item has an expanded ComboBox that show which materials the user selected (user being able to select multiple materials, shown inside the combobox).

I'd like to limit the combo to make one choice from the list, and lock out the *add new choice line after.
 
Last edited:
How are the users selecting the items that are placed into the combobox? Are you talking about a listbox and not a combobox? When the user selects an item, how does it get populated into the "combobox"? With Code? If there is code, please post it.
 
I have attached a picture of what I am explaining below.

I know I could rebuild the table structure to accomplish what I want, but that would be exhaustive considering the amount of work required (forms are already built, db working, just trying to dumb it down....tool used in previous db).

Notice the "*" line for adding additional materials. I want to limit it to choosing one item from the drop down, and then stop it at that...no second material yada yada....

But there is no property I know of.

The combo is based on a select statement (SELECT blah.blahPK, blah.name FROM yada ORDER BY blah.name) so forth and so on.
 

Attachments

  • Image2.jpg
    Image2.jpg
    30.9 KB · Views: 187
The current method you are using would prohibit that kind of restriction I believe. Because what you are doing is essentially looking directly at the table when you are in Datasheet view, and if you are allowing any additions at all, it will always allow you to add additional items. I don't believe that there are any properties/methods that would allow you to do what you want.

A way to accomplish this without restructuring your tables would be to redo the form. I see that you have this portion sectioned off into a tab view control on a subform, so you would only need to modify this portion. Instead of making this subform appear in datasheet view, use actual controls (textboxes, listboxes) to display/edit the information in. You will then have all of the control over the controls that you would need to accomplish this.

Thats all I've got, sorry if it wasn't more help.
 

Users who are viewing this thread

Back
Top Bottom