Solved

additem to datacombo at runtime

Posted on 2004-03-27
1
541 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 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

10 Experts available now in Live!

Get 1:1 Help Now