Solved

additem to datacombo at runtime

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
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…
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…

705 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