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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|