Adding data to a table using a form

O

Orla

Probably a dead simple question!

I want to add data to a table using a form. At the end of the form I want to add a command button or something that simply says 'Submit'. This will add that specific record to the table, save the table and reset the form for data entry.

How do i do this?

Cheers

Orla
 
W

Wayne Morgan

If the form and controls are bound, it is fairly simple. With bound controls
Access will automatically save changes when you move off of the record. You
can also issue a command to save the changes if you prefer.

To bind the form, set the form's RecordSource to the name of the table or a
query based on the table. To the controls, set the controls' ControlSource
to the names of fields in the table.

To get the button to save and move to a new record, you could use code such
as this in the button's Click event.

Me.Dirty = False
DoCmd.GoToRecord ,,acNewRec
 
L

Larry Daugherty

Hi Larry,

Just create your form and enter your data, all of the functionality comes
for free. You don't need a Submit button. Just moving the form off the
record will automatically save the record to the underlying table.

HTH
--
-Larry-
--

Orla said:
Probably a dead simple question!

I want to add data to a table using a form. At the end of the form I want
to add a command button or something that simply says 'Submit'. This will
add that specific record to the table, save the table and reset the form for
data entry.
 
Top