Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box help

Status
Not open for further replies.

ChemistZ

Programmer
Oct 30, 2001
70
US
I need to know if what I want to do is even plausible. I want to create a form where a user can enter their main business functions to a list or combo box. I won't know in advance how many they will enter so I need for the list to just keep adding them as they go. Next, I need when they finally click submit for all those functions to be loaded into a table. Hwo do I do this when I am not sure how many they will have entered? How do I prepare the back end table for this?
 
I would say that it's doable but most likely not desirable. Combo boxes are meant to help users choose one item out of a list of items. You are looking for a way for users to enter data. I would suggest you use a subform for the input. Just have the user type in as many rows as he or she wants. When done, the user will have two ways of closing the form: one button will save the info and close the form (really, just closing the form, as the info is already saved), and the other button will toss the new items and close the form.

To do this, make the main form have a hidden control that gets seeded with CurrentUser & Now when the form is opened. When you pick the child/master link forms to join the main form and the subform, use whatever other field you might use and this control on the main form, along with a matched pair in the subform (you'll need these fields in the table that holds the subform data). When it's time to delete, if that's the user's choice, you'll be able to delete everything where that field matches what's currently in the hidden control on the main form.

OK, so that's a bit complex, if you're not used to this sort of thing, but none of the pieces of the task are so difficult. The main hting I'd want to say to you is that it's probably best to use something other than a combo box if the main activity will be adding records. If you decide to use the model I laid out here, just take it one step at a time. Make the table for the data for the subform. Make the form and the subform. Add the invisible controls. Make the button that saves the info. Make the button that deletes the info.

And if you have trouble, come on back with more questions.

Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top