Adding data to a table using a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top