Adding a record only after clicking OK button

gringope24

Member
Local time
Today, 18:56
Joined
Apr 1, 2020
Messages
51
Hello folks,
the easiest way to add new record seems to be opening a bound a form with a below code and just enter data.
Code:
DoCmd.OpenForm FormName:="frmAddNewCustomer", DataMode:=acFormAdd

But this method creates a new record when just even one field will be filled.

I want to create a new record after user will fill the field/fields and with full awareness click OK button.

What is the easy way to do it? I thought about creating an unbound form and sending values from the field to the table using SQL or by AddNew Recordset, is it good approach?

Secondly (for general information), what is faster and more efficient method to add new record:
1) using SQL statement and run with command CurrentDb.Execute strSql ?
2) use Recordset ?
3) define a query in Access and fire it with QueryDef.Execute ?

Thanks for your support in advance.
 
@gringope24

This may or may not be of interest to you:

 
Pat I know we've talked about this before and I thoroughly respect your approach because I feel like both of them have advantages and disadvantages. But I'm quite happy with my method of bound forms which is not to allow an automatic save except through explicit use of a save button, with occasional exceptions. It's quite easy to create these exclusions and it has worked well for me to be able to tell my users one simple instruction, that is, nothing will be saved unless you press save.

Again though, I respect your approach because you pointed out to me enough things to remind me that the different approaches have pros and cons.
 

Users who are viewing this thread

Back
Top Bottom