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!

Variable Syntax in IF..THEN 1

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
Hello,

I'm trying to find the correct sytnax for the following...
dim j
j = InputBox ("Enter Logoff Time in Military Format")

If SysTime > "# & j & #" Then...<<this doesn't and many other variations do not work>>

However, if I write:
If SysTime > #18:30# Then...<<this works>>

How can I pass j into the If Then statement?

Thank you..........RO
 
A starting point:
If IsDate(j) And SysTime > TimeValue(j) Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well there's no problem with the first part of the statement: If SysTime > 'SysTime has been dimmed

I need to get the exact syntax for the condition after the > which is #j# >>This I cannot figure out...
 
date and time literals must be imbeded inside #'s.
like #18:30# or #8/02/2006#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top