Solved

additem to datacombo at runtime

Posted on 2004-03-27
1
538 Views
Last Modified: 2010-05-18
I know that using a listbox or combo box I can add information at runtime such as additem.thisthing   but how would I do this using a DataCombo?
I am currently using a recordset to loop through fields in a table and this appears on a combo box. I also needed to add something at runtime and was able to additem so that it appears at runtime, but it's not stored in the database.

So how do you additem to a datacombo if possible?
I would need to see some code that can do this.
Thanks
0
Comment
Question by:mindserve
1 Comment
 
LVL 76

Accepted Solution

by:
David Lee earned 125 total points
ID: 10696812
Let me restate the problem to make sure I understand what it is you want.  You have a DataCombo control and you want to be able to add values to it at runtime and have those new values stored in the database that the DataCombo draws from.  Is that correct?  You also state that you've figured out a way to add a new item to the DataCombo control.  I'm not aware of any way to use AddItem with the DataCombo control so I'm guessing that you're setting DataCombo.Text to the new value.  Do I have that right?  Assuming I'm correctly understanding the issue, then this solution should do the trick.  Add a command button titled "Add" or "Add New" or something like that next to the DataCombo control.  There are then two ways to go.  One, you can have the Add button popup a dialog box and ask the user for the new value to add.  Two, you can have the user type the new value into the DataCombo and then click the Add button to add it into the database.  After adding the new value you should tell the DataCombo control to Refill itself to refresh its content.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now