Made a table and made a form. Is it possible to enter information into a
form and use a command/control button for the information to "post" to the
table? I notice that the field is updated each time a user tabs or moves to
the next field in the form. I need to know what type of controls I can put
in place which will allow confirmation of all the information prior to it
being entered into the table.
Actually, the data is updated when a user moves to another record (not when
you move from control to control, unless you have code to save the record in
one of the Lost Focus, After Update, etc. events of the control).
You can use the form's BEFORE UPDATE event to cancel the update if you wish,
or have a command button which saves the record.
This is sample code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Len(Nz(Me.txtSampleField,””) & “”) = 0 Then
If MsgBox("You must enter a value before continuing." & _
“Would you like to continue with this record?”, vbYesNo + vbQuestion,
"Sample Company, Inc.") = vbYes Then
Cancel = True
Me.txtSampleField.SetFocus
Else
Cancel = True
Me.Undo
End If
End If
End Sub

Signature
Bob Larson
Access World Forums Super Moderator
Tutorials at http://www.btabdevelopment.com
__________________________________
> Made a table and made a form. Is it possible to enter information into a
> form and use a command/control button for the information to "post" to the
> table? I notice that the field is updated each time a user tabs or moves to
> the next field in the form. I need to know what type of controls I can put
> in place which will allow confirmation of all the information prior to it
> being entered into the table.
rmichaux - 15 Apr 2008 12:59 GMT
That looks like Visual Basic line code, correct? I am not that advanced and
have used the wizards to create the table and form. Is there a way to
see/access the line code?
rmichaux
> Actually, the data is updated when a user moves to another record (not when
> you move from control to control, unless you have code to save the record in
[quoted text clipped - 26 lines]
> > in place which will allow confirmation of all the information prior to it
> > being entered into the table.