Want value of combo box on a form to appear in table

SD23

Registered User.
Local time
Today, 00:15
Joined
Jun 13, 2006
Messages
60
I am very new to Microsoft Access and I needed some help. I added a combo box to a form and I want the value in that combo box to appear in a table. I was wondering if anyone knew the correct code to do this. I would really appreciate some help. Thank You.
 
cant you just fire an insert query based on the result in the combo box?
 
just create a table or use one u have. with a field that you want to add to
create a textfield to hold the value of the combo selection
(this may be the long way around)

Dim MyDB As Database
Dim yourtable As Recordset
Dim intTemp As Integer

Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set yourtable = MyDB.OpenRecordset("yourtable", DB_OPEN_TABLE) 'DB_OPEN_DYNASET if using linked tables

intTemp = Me.yourcombobox.ItemData(0)
Me.temporarytextbox = intTemp

yourtable.AddNew
yourtable("fieldname") = Me.temporarytextbox

yourtable.Update
yourtable.close
 
Last edited:
this may be the long way around
That I agree with.


What is wrong with the sample I posted?

No code and I believe the correct method.
 

Users who are viewing this thread

Back
Top Bottom