Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Time Format & Unload problem

I have a Textbox that is used for a Time Input
I want the user to only be allowed to enter the info in the right format
I.a. 12:30 I think the part that is important is the : in the middle.

Also when the user clicks the command button An if statement is run to
verify that all fields have been filled in. If not then a msgbox comes up
stating that all info must be filled in.
The problem is when the msgbox is closed then the unload me is run and the
info that was put in is acted on
I fixed that by making all variables = "" However the form still closes
and needs to be run again.

Is their a way to allow the user to fill in the remaining boxes if the if
statement is true. Or is there another way

Thanks Rod Taylor




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Time Format & Unload problem

Rod,

If 'Verify that all fields have been filled in' then
'Act on your data
Unload Me
Else
Msgbox "Not all fields have been completed." & Chr(13) & _
Complete ALL fields and click the OK button again"
End If
End Sub

HTH
Henry


"Rod Taylor" wrote in message
...
I have a Textbox that is used for a Time Input
I want the user to only be allowed to enter the info in the right format
I.a. 12:30 I think the part that is important is the : in the middle.

Also when the user clicks the command button An if statement is run to
verify that all fields have been filled in. If not then a msgbox comes up
stating that all info must be filled in.
The problem is when the msgbox is closed then the unload me is run and the
info that was put in is acted on
I fixed that by making all variables = "" However the form still

closes
and needs to be run again.

Is their a way to allow the user to fill in the remaining boxes if the if
statement is true. Or is there another way

Thanks Rod Taylor






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Time Format & Unload problem

Someone asked for the code on the unload issue
If Leave_REQ = "" Or REQ_CONT_INT = "" Or AL_DMN = "" Or AL_ConTyp = "" Or
ST_Time = "" Or ET_Time = "" Then
MsgBox ("You must Fill in all INFO to make A Request")
Leave_REQ = "": ST_Time = "": ET_Time = "": REQ_CONT_INT = "": REQ_INFO
= ""
AWS = "": AL_DMN = "": SHFT = "": TODAY_TIME = "": FPE = "": AL_ConTyp = ""
End If


This is the if statment and it cleares all the info would rather not clear
the info but allow the user to fill in the required info.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Time Format & Unload problem

Hello,

Set Cancel =True:
If Leave_REQ = "" Or REQ_CONT_INT = "" Or AL_DMN = "" Or AL_ConTyp =
"" Or
ST_Time = "" Or ET_Time = "" Then
MsgBox ("You must Fill in all INFO to make A Request")
Leave_REQ = "": ST_Time = "": ET_Time = "": REQ_CONT_INT = "":
REQ_INFO
= ""
AWS = "": AL_DMN = "": SHFT = "": TODAY_TIME = "": FPE = "": AL_ConTyp
= ""
Cancel=True
End If
Heiko
:-)
"Rod Taylor" wrote:

Someone asked for the code on the unload issue
If Leave_REQ = "" Or REQ_CONT_INT = "" Or AL_DMN = "" Or AL_ConTyp = "" Or
ST_Time = "" Or ET_Time = "" Then
MsgBox ("You must Fill in all INFO to make A Request")
Leave_REQ = "": ST_Time = "": ET_Time = "": REQ_CONT_INT = "": REQ_INFO
= ""
AWS = "": AL_DMN = "": SHFT = "": TODAY_TIME = "": FPE = "": AL_ConTyp = ""
End If


This is the if statment and it cleares all the info would rather not clear
the info but allow the user to fill in the required info.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Time Format & Unload problem

Rod,

As per my earlier post, this will check all the fields have an entry.
If so, it will do your actions and leave the sub.
If any of your fields are empty, it'll put up your messagebox.
When the user clicks OK on the message box, the message
box will go and will show the form as it was before the message box
appeared.
In other words, the user won't be able to leave the form until there is an
entry in
all of your fields.


If Leave_REQ < "" And REQ_CONT_INT < "" And AL_DMN < "" _
and AL_ConTyp< "" And ST_Time < "" And ET_Time < "" Then
'This checks that all of your fields have an entry (therefore, none are
empty)
'
'
'
' 'Act on your data here
'
'
'
Unload Me
'unload the form
'
'
Else
'At least one of your fields is empty
MsgBox ("You must Fill in all INFO to make A Request")
End If
End Sub

"Rod Taylor" wrote in message
.. .
Someone asked for the code on the unload issue
If Leave_REQ = "" Or REQ_CONT_INT = "" Or AL_DMN = "" Or AL_ConTyp = "" Or
ST_Time = "" Or ET_Time = "" Then
MsgBox ("You must Fill in all INFO to make A Request")
Leave_REQ = "": ST_Time = "": ET_Time = "": REQ_CONT_INT = "":

REQ_INFO
= ""
AWS = "": AL_DMN = "": SHFT = "": TODAY_TIME = "": FPE = "": AL_ConTyp =

""
End If


This is the if statment and it cleares all the info would rather not clear
the info but allow the user to fill in the required info.





Reply
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
Time Format Problem John Calder New Users to Excel 3 August 19th 09 01:49 AM
format time problem Pyrite Excel Discussion (Misc queries) 5 September 8th 08 06:48 PM
time format problem P Boric Excel Worksheet Functions 2 August 27th 07 08:49 AM
Time format problem chrisbarber1 Excel Discussion (Misc queries) 8 August 5th 06 03:54 PM
A Time Format Problem PA New Users to Excel 5 May 24th 06 06:25 AM


All times are GMT +1. The time now is 08:52 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"