Re: DAO Recordset Help
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 06:52:01 -0400
Unfortunately, that won't meet one of the requirements: "Should they choose
not to save, the autonumber on the table should not advance."
However, I'd challenge that requirement anyhow. Autonumber fields exist for
one purpose: to provide a (practically guaranteed) unique number that can be
used as a primary key. No meaning should be attached to its value. In fact,
it's generally considered a good idea not to even show its value to the
users. Be aware that should you even need to replicate the database, the
Autonumber fields would all be changed from sequential to random.
Should they choose to ignore this advice, it would be possible to create an
unbound form that let them play with the entry, and only save it once they
were satisfied with it (using either an INSERT INTO SQL statement, or adding
to a recordset). However, in a multi-user environment, there would be no way
to know what the value of the Autonumber field is going to be in advance.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Ken Snell (MVP)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23azgSqKzGHA.1256@xxxxxxxxxxxxxxxxxxxxxxx
You may be overengineering this.
Set the form's recordsource to a query that will give you the desired
recordset. Then open the form in "data entry" mode:
DoCmd.OpenForm "FormName", , , , , acFormAdd
--
Ken Snell
<MS ACCESS MVP>
"apollo8359" <apollo8359@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8538B161-DFCC-446B-B3BE-CFED2D84938F@xxxxxxxxxxxxxxxx
I need a lesson in recordsets. I want to use a recordset to open a form
and
add a new record. I am having trouble finding all the necessary code to
create the recordset, make the form use that recordset and then update
the
table after they choose to save it. Should they choose not to save, the
autonumber on the table should not advance. If I get comfortable with
this
code, I will use it to speed up the main form by calling only one record,
rather than open the entire query as its recordsource, however, I need to
lock the edited record, is this possible? This is a multi-user database
with
the tables on the network, but I can't find the code I need to accomplish
these prefered programming methods. Any help would be greatly
appreciated.
I'll even buy a book if it has DAO code, not ADO, or read an article
somewhere, I just need to get this clear in my head.
Regards,
Michael
.
- Follow-Ups:
- Re: DAO Recordset Help
- From: Ken Snell \(MVP\)
- Re: DAO Recordset Help
- References:
- Re: DAO Recordset Help
- From: Ken Snell \(MVP\)
- Re: DAO Recordset Help
- Prev by Date: Re: Link to open text file
- Next by Date: getrows only getting one row?
- Previous by thread: Re: DAO Recordset Help
- Next by thread: Re: DAO Recordset Help
- Index(es):
Relevant Pages
|
Loading