Re: 2003: record writes through form
From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 07/11/04
- Next message: anonymous_at_discussions.microsoft.com: "Re: Problems with OpenRecordset (using a query)"
- Previous message: Dirk Goldgar: "Re: subfrom controls"
- In reply to: Jim Shores: "2003: record writes through form"
- Next in thread: Jim Shores: "Re: 2003: record writes through form"
- Reply: Jim Shores: "Re: 2003: record writes through form"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 11 Jul 2004 12:27:58 -0400
"Jim Shores" <jimyoubetternotcryS@bellsouth.wet> wrote in message
news:0CDC0CFE-D03C-4C0A-B418-8725E4B52F12@microsoft.com
> Hi,
> It's been bugging me, OK, a frmTransX, has a mere 354 records to
> its credit. The table is tblTransX, the pkey and a date and memo
> fields. TransXDetail is many-to-many also with tblAccts. It has a
> DoCmd.Save button even, but still, I'll be filling out a new
> record, to go to tblTransX, with tblTransXDetails . . . And later or
> right away I notice the thing has forgotten what I put in the edit
> controls. If this makes no sense, please pardon me. I do not
> automatically get a new AutoNumberwhen I mash asterisk. Reader, do
> you know how one might instruct the form to finalize a new record
> before I fill-out the form, so I don't have to worry about whether it
> picked up the stuff entered in the form?
Your question is a little unclear, but one thing you may not be aware of
is that the statement DoCmd.Save does *not* save the form's current
record. It saves the *design* of the form, not its data. If you need
to use code to save the current record before Access would normally do
so, use
RunCommand acCmdSaveRecord
or
Me.Dirty = False
(I like "Me.Dirty = False", but if the record can't be saved for some
reason, the error message you get is a little misleading -- it talks
about being unable to set a property, rather than being unable to save
the record.)
Normally, Access will save the form's current record automatically (if
it has been modified) whenever you move to a different record, or close
the form, or switch the focus from the main form to a subform. So I'm
not sure why you would be having records that aren't saved eventually,
if not when you click your save button.
-- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup)
- Next message: anonymous_at_discussions.microsoft.com: "Re: Problems with OpenRecordset (using a query)"
- Previous message: Dirk Goldgar: "Re: subfrom controls"
- In reply to: Jim Shores: "2003: record writes through form"
- Next in thread: Jim Shores: "Re: 2003: record writes through form"
- Reply: Jim Shores: "Re: 2003: record writes through form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|