if statment based on elapsed time ..

  • Thread starter Thread starter Jim in Arizona
  • Start date Start date
J

Jim in Arizona

I want to make buttons available or not available based on how much time
has elapsed.

An example:

If NOW() > 8 hours then btnOne.Visible = False

Thanks.

Jim
 
Patrice said:
And the problem you have is ? You can use the Hour method to get the hour
for the date object.

Try :
http://msdn2.microsoft.com/en-us/library/system.datetime.hour(VS.80).aspx

If Now.Hour>8 etc... (I would use Now.Hour>=9 for clarity)

Note also that this is server side code i.e. it won't if someone from
another time zone can connect (in this case you'll need likely to do this
client side using JavaScript).

I also found this resource:

http://blogs.msdn.com/vbfaq/

I'm actually making a communication log that employees in one location
on our domain will be using to pass down notes from one shift to the
next. I wanted to make sure that after they post that they will only be
able to modify their post for a few hours time then after that elapsed
time, the 'modify' and 'delete' buttons no longer show up.

I'll see if I can make your idea, along with what I found, work for this
project. If I can't, I'll be back.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top