Update on Save Only

brsawvel

Registered User.
Local time
Today, 17:25
Joined
Sep 19, 2007
Messages
256
I have a form that opens in new and includes a couple fields with DMAX code On Load. But, sometimes the rest of the form isn't filled out. Is there a way to set the form to save only when the other fields are populated? Otherwise, I end up with a table with a bunch of empty records.
 
Thanks! But, I think my problem is a little bigger than I thought. Now, I'm trying to set some of the fields to copy by DLast. The DMax fld works just fine, but the remainder populate based on a row in the middle of my table (confirmed by a Me.Refresh test). I can't seem to figure out why. I have the table and a query set to ORDER BY fldA and fldB, but the form still considers the middle of the table and query to be DLast. Argh!!!

Here's what I tried...

DoCmd.GoToRecord Record:=acNewRec (Variant: DoCmd.GoToRecord,,acNext)
Me.fldA = DMax ("[fldA]", "tblA")
Me.fldB = DLast ("[fldB]", "tblA") + 1
Me.fldC = DLast ("[fldC]", "tblA")

Do you know what I'm doing wrong?
 
If you assign the values to fldA, fldB, fldC and fldD, using their Default Value Property, the Record will only save if other/additional data is entered.

Linq ;0)>
 
How do you use the result of the DMax() in the criteria of others?
 
DLookup("Field", "Table", "KeyField = " & DMax(...))
 
What goes in "KeyField ="? I think that's clogging it up...
 

Users who are viewing this thread

Back
Top Bottom