Solved

additem to datacombo at runtime

Posted on 2004-03-27
1
547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA: Select SQL query based on a config Sheet v2 11 54
Child Form in front 4 64
Problem to With line 4 84
Export PDF Form fields to Access  or Excel  in Tab order 16 126
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

742 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