Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data entry before closing

Status
Not open for further replies.

kpryan

Technical User
Aug 24, 2005
282
US
Hi
I am looking for a way to stop lazy staff from closing a form before they have entered all data
I want a message box to appear warning them to fill in this text box(s) and that the form will not close until its done. I have made the form a modal form.
In this way the database will be useless until they complete all text boxes.

Many thanks,

KP
 
First, on the property sheet of the form, set Cycle to Current Record. This'll prevent them from going to a new record by tabbing and saving the data all ready there. So, you'll create a command button to Save the record. You can do this with the command button wizard. Then you can go to the code of the button (Property sheet, On Click) and write some data entry validation for the controls you want. Using an If statement and using the MsgBox function, you can put out a message stating which controls are not filled in. And using the SetFocus property of a control, you can place the cursor in the control that needs data.
If you have problems coding, post your code. Someone will probably help.
 
or you can use the forms [blue]Before Update[/blue] event to validate textboxes of interest have required data!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi kpryan,

You could do something like this:

Code:
If Trim(Me.Textbox1) & "" = "" then
Msgbox("Hey lazy worker, you have to set a value for Textbox1...")
me.Textbox1.setfocus
exit sub
end if

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top