Combo boxes

mkelly

Registered User.
Local time
Today, 01:48
Joined
Apr 10, 2002
Messages
213
Is it possible to have a combo box save 2 different fields into a table?

If so how is it done?

Thanks for any help
 
mkelly,

If the combo's rowsource is something like:

Code:
Select a, b, c
From   SomeTable
Order By a

Then if you are using a "bound" form, use the combo's
AfterUpdate event to:

Me.SomeControl = Me.MyCombo.Column(1) ' Assign value of b
Me.SomeControl = Me.MyCombo.Column(2) ' Assign value of c

Otherwise, you'd do an insert:

Code:
Dim dbs As DataBase
Dim sql As String

Set dbs = CurrentDb

sql = "Insert into OtherTable (b, c) " & _
      "Values ('" & Me.MyCombo.Column(1) & "', '" & _
      Me.MyCombo.Column(2) & "')"
dbs.Execute(sql)

Wayne
 

Users who are viewing this thread

Back
Top Bottom