View Single Post
  #3  
Old August 20th, 2009, 08:22 PM posted to microsoft.public.access.gettingstarted
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Adding new records via recordset

am I just going at this the hard way?

Yes

just opening the form creates a new record in the table even if the user
never enters anything.

That's not correct! Something has to be entered before anything (a new
record) is saved.

Using a form to enter records is the correct way. If you want to check
before saving each new record, put code in the form's BeforeUpdate event
asking the user if he wants to save what he just entered and Cancel if he
says No.

Steve


"ssutton503" wrote in message
...
I want to create a form for the user to input some new jobs but I don't
want
the form bound to a table (as I originally did). I don't like the fact
that
just opening the form creates a new record in the table even if the user
never enters anything. What I'm thinking should happen is when the form
opens
it creates a recordset, the new entries get added to the recordset, then
the
user can choose to add the records from the recordset to the actual table
when they get done. Only problem is, I don't know how to do that. I know
how
to create a recordset from an existing table but that seems a bit silly to
load the entire table when I just need the database structure for the
recordset. Can I just create a recordset, add the user's entries to the
recordset, then loop through the recordset and add the new records to the
table with and INSERT statement? Or am I just going at this the hard way?
Any
suggestions would be greatly appreciated.