Adding information in a table automaticly with just a few entries.

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I am trying to enter 5 peices of Information and with this information Access
then Adds to a table that has 16 fields in it. I am not sure how to proced.
 
Randy,

Start by creating a form. Put your 5 text boxes (or combo boxes, etc) on
the form. Then put a command button on the form. In the OnClick event of
the combo box you'll want to write code something like the following:

Dim db as Database
Dim rs as Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("MyTable", dbOpenDynaset)

rs.AddNew
rs!Field1 = MyTextBox1
rs!Field2 = MyTextBox2 'etc.
rs.Update

Set rs = Nothing
Set db = Nothing
 
I am trying to enter 5 peices of Information and with this information Access
then Adds to a table that has 16 fields in it. I am not sure how to proced.

Simplest would be to just create a Form based on the table. Enter the five
values you want added on the form; Access will automatically save the record
to the table when you move off it or close the form.

You don't say what the sixteen fields are, whether they're required, or what
they have to do with the five fields you're adding, so I'm not certain this
adresses your question!
 
Back
Top