A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data Entry Form Control



 
 
Thread Tools Display Modes
  #1  
Old April 14th, 2008, 01:00 PM posted to microsoft.public.access.gettingstarted
rmichaux
external usenet poster
 
Posts: 2
Default Data Entry Form Control

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
  #2  
Old April 14th, 2008, 08:52 PM posted to microsoft.public.access.gettingstarted
boblarson
external usenet poster
 
Posts: 886
Default Data Entry Form Control

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

--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


"rmichaux" wrote:

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

  #3  
Old April 15th, 2008, 12:59 PM posted to microsoft.public.access.gettingstarted
rmichaux
external usenet poster
 
Posts: 2
Default Data Entry Form Control

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


"boblarson" wrote:

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

--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


"rmichaux" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.