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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I set up a combo box to add the values typed to a table if not

Status
Not open for further replies.

iccpm

MIS
Apr 22, 2000
17
0
0
US
I need to make a combo box lookup values in a table, and also have entering data into the box write that dat to the table, while still saving the values to the table in use on the form. Is this possible?
How?
Thanks
 
The combobox wizard should be able to do all you requested just select the correct options when you run the wizard. When in design mode drop the combo box from the Tool box onto your form and the wizard will walk you through.
 
To enter new data into a combo box based on an external table, use this statement on the OnClick event of a control button. You have to update the external table to save the data.

Dim varName As Variant
varName = InputBox("Enter New Name")
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(&quot;<name of external table>&quot;, dbOpenDynaset)
With rst
.AddNew
!<FieldName in table> = varName
.Update
Me.<ComboBoxName>.Requery
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top