Empty records (1 Viewer)

mveijndh

Registered User.
Local time
Today, 14:14
Joined
Dec 17, 2011
Messages
113
I have a form based on a table. The moment I open the form and change one value, a record is created in the table. I don't want the record being created after the first field change, but only after the last field has been changed.
How can I arrange his to happen?
 

plog

Banishment Pending
Local time
Today, 16:14
Joined
May 11, 2011
Messages
11,670
Going to have to go unbound--the form has to be seperated from the table. Do that by changing the forms Record Source property to nothing. Then to have it save when you want, you need to put some code on an event of that last input. That code would be VBA that executes an SQL INSERT statement to take all the input data and put it into the table.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:14
Joined
Jan 20, 2009
Messages
12,859
Rather than going unbound it is much better to use a Transacted Bound Form.

See post 9 on this thread for an example.
 

sneuberg

AWF VIP
Local time
Today, 14:14
Joined
Oct 17, 2014
Messages
3,506
Actually I don't believe an update occurs until the form loses focus. I once came across a thread where the forum member's customer required that he update the table every time a field was changed and he found that quite challenging. I think if you look at the table and modify fields in a form you won't see any changes until you move to another record, a subform, or close the form.

What is your concern? What are you trying to accomplish/avoid?
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:14
Joined
Jan 20, 2009
Messages
12,859
Actually I don't believe an update occurs until the form loses focus.

That is correct. The record must be cancelled before leaving the form if it is not to be saved.

Starting a new record uses up an Autonumber even if the user cancel the record. Maybe they are worried about this? If that is the case then they should not be using Autonumber for the job.
 

Users who are viewing this thread

Top Bottom