Adding Form Contents to Table

  • Thread starter Thread starter Paul Murphy via AccessMonster.com
  • Start date Start date
P

Paul Murphy via AccessMonster.com

Hi,

Could someone point me in the right direction on this one...
I have a form with 3 combo boxes and 2 text boxes.

I need to add this info to a table which I have already set up but am not
sure how to do it??

Thanks in advance,

Paul
 
You need to have a field in the table that you want to put the data into.
Then right click on the field in the form and select properties. Under the
data tab, click in control source, then the little arrow that appears on
the end. Select from this the field in the table that you want to put the
data into. If you want to put it into a different table, you must press
the ... then tables then the right one, then the field. Ask if unclear or
doesn't help.

Samantha Rawson
 
Hi Samantha,

Thanks for your quick reply...
Sorry, not sure what 'AS' Computing is?

When I go to the 'Data' Table, then Control Source and click the little
arrow no tables appear. So i tried to click the ... button and select a
field from a table that way but after clicking 'OK' The Control Source is
still empty....?

Does the form and table have to be linked in any way first?

Thanks,
Paul
 
hi,
a record set might do it.
Dim Db As Database
Dim rs As Recordset
Set Db = CodeDb()
Set rs = Db.OpenRecordset("yourtable", dbOpenDynaset)
With rs
.AddNew
!tablefield1 = combobox1
!Tablefiled2 = combobox2
!Tablefiled3 = combobox3
!Tablefiled4 = textbox1
!tablefiled5 = textbox2
.Update
end with
rs.Close
Db.Close
MsgBox (" Record was added.")
 
Back
Top