LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Check UserForm Values Before Saving

Hi,
Prio to saving UserForm values to a worksheet I want to verify that a user
has completed all sections on the form. I have written the following code
that traps the missing entries and displays a dialog box. Unfortunately the
dialog box then closes and rather than SetFocus the data is transferred to
the database worksheet. How can I stop the code to force the user to
complete the missing entry and click the 'Submit' buttton?

Thanks for any help,
Mickey
================================================== ========================
If ComboBoxPIN.Text = "" Then MsgBox "You Must Enter a PIN Number."
ComboBoxPIN.SetFocus
ElseIf Me.ComboBoxDate.Value = "" Then
MsgBox "You Must Enter a Date."
ComboBoxDate.SetFocus
ElseIf ComboBoxArea.Text = "" Then
MsgBox "You Must Enter a Location for this activity."
ComboBoxArea.SetFocus
ElseIf ComboBoxActivity.Text = "" Then
MsgBox "You Must Enter an Activity."
ComboBoxActivity.SetFocus
ElseIf ComboBoxOffence.Text = "" Then
MsgBox "You Must Enter an Offence."
ComboBoxOffence.SetFocus
ElseIf TextBox11.Text = "" Then
MsgBox "You Must Enter a Reference Number."
TextBox11.SetFocus
Exit Sub
End If

<following code then copies the userform values to the database worksheet


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Userform as Gif Robert[_24_] Excel Programming 7 June 13th 13 05:12 AM
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
UserForm value check Dan Excel Programming 1 November 1st 04 05:21 PM
Spell Check Within a UserForm? jennie Excel Programming 2 October 20th 04 07:56 PM
Can't check checkboxes in userform ... sometimes DFStoneJr Excel Programming 1 June 25th 04 02:19 AM


All times are GMT +1. The time now is 11:40 AM.

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

About Us

"It's about Microsoft Excel"