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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop code from running:require user input

Status
Not open for further replies.

autoIT

IS-IT--Management
May 10, 2006
68
US
The DB is for HR.
HR inputs information on the employee. If it's the first record of the year for the employee, the starting vaca hours will be set to 0. I have a msg box that asks if the employee has vaca hours to use or would they like to enter the ammount of hours the employee has to start. If HR replies with "yes"(the employee has hours to use) I need the code to stop running in order to have HR enter the hours. I have tried all kinds of if statement, and do loops. I either send it into infinite loops or the code completes and enters the record into the tabel. How do I stop the code from running so that more info can be entered?

Adam
 
How about something like this

dim dblHours as double 'Adjust to integer if necesarry

if msgbox ("Does the emp have vaca hours to use",vbyesno) = vbyes then
do while dblhours = 0
dblhours = inputbox ("Enter the number of hours")
loop






No you have the hours in a variable to use. Let the code continue.







Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
input box
I didn't knw that code existed.
Thanks alot for enlightening me.
That helps greatly


Adam
 
Your very welcome!

Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top