Conditional Format logic

G

Guest

Hello.

I have a subform with the following fields:

Date (tied to the parent table and Form)
Name
LoginTime
LogoutTime

I would like to create conditional formatting on the login and logout fields
that will show folks how many people are logged in. The logic would be
something like: if the current time is between the LoginTime and LogoutTime
then make these fields Blue.
What I need to do is regulate the amount of concurrent users to 4 that are
accessing a resource. They are supposed to go into this Database, put there
name and login/logout times. The problem is when you have 20 records with
many Login and Logout times, things can get really confusing.
I would like only the records that currently have a login and logout time
that is active, i.e. if it is 11am then I want all records that have
something like 10am-12pm or 7am-2pm to show up as Blue.

Is this possible?

Iram/mcp
 
J

John W. Vinson

Hello.

I have a subform with the following fields:

Date (tied to the parent table and Form)
Name
LoginTime
LogoutTime

I would like to create conditional formatting on the login and logout fields
that will show folks how many people are logged in. The logic would be
something like: if the current time is between the LoginTime and LogoutTime
then make these fields Blue.
What I need to do is regulate the amount of concurrent users to 4 that are
accessing a resource. They are supposed to go into this Database, put there
name and login/logout times. The problem is when you have 20 records with
many Login and Logout times, things can get really confusing.
I would like only the records that currently have a login and logout time
that is active, i.e. if it is 11am then I want all records that have
something like 10am-12pm or 7am-2pm to show up as Blue.

Sure. Use "Expression Is" as the condition, and

Time() >= [LoginTime] AND Time() <= [LogoutTime]

Note that if you're storing pure time values in these fields, then it's
ambiguous whether 11:00 am means 11:00am today, or yesterday, or eight years
ago; all Time() values are times on December 30, 1899, the base of date/time
fields. You may want to store the current DATE AND TIME using Now() in the
Logintime and Logouttime fields, and use Now() instead of Time() in the
expression.

John W. Vinson [MVP]
 
G

Guest

Thankyou, Thankyou, Thankyou.

It worked.

Iram

John W. Vinson said:
Hello.

I have a subform with the following fields:

Date (tied to the parent table and Form)
Name
LoginTime
LogoutTime

I would like to create conditional formatting on the login and logout fields
that will show folks how many people are logged in. The logic would be
something like: if the current time is between the LoginTime and LogoutTime
then make these fields Blue.
What I need to do is regulate the amount of concurrent users to 4 that are
accessing a resource. They are supposed to go into this Database, put there
name and login/logout times. The problem is when you have 20 records with
many Login and Logout times, things can get really confusing.
I would like only the records that currently have a login and logout time
that is active, i.e. if it is 11am then I want all records that have
something like 10am-12pm or 7am-2pm to show up as Blue.

Sure. Use "Expression Is" as the condition, and

Time() >= [LoginTime] AND Time() <= [LogoutTime]

Note that if you're storing pure time values in these fields, then it's
ambiguous whether 11:00 am means 11:00am today, or yesterday, or eight years
ago; all Time() values are times on December 30, 1899, the base of date/time
fields. You may want to store the current DATE AND TIME using Now() in the
Logintime and Logouttime fields, and use Now() instead of Time() in the
expression.

John W. Vinson [MVP]
 
G

Guest

John, I know since you can answer this question you can answer my next
question that will solve problems in about 4 of the databases that I have
created.
Could you look up my posting in "Access Database Programming". I created
that posting on 4/11/07 @ 4:09pm PST.
I would really appreciate it!

Iram/mcp



John W. Vinson said:
Hello.

I have a subform with the following fields:

Date (tied to the parent table and Form)
Name
LoginTime
LogoutTime

I would like to create conditional formatting on the login and logout fields
that will show folks how many people are logged in. The logic would be
something like: if the current time is between the LoginTime and LogoutTime
then make these fields Blue.
What I need to do is regulate the amount of concurrent users to 4 that are
accessing a resource. They are supposed to go into this Database, put there
name and login/logout times. The problem is when you have 20 records with
many Login and Logout times, things can get really confusing.
I would like only the records that currently have a login and logout time
that is active, i.e. if it is 11am then I want all records that have
something like 10am-12pm or 7am-2pm to show up as Blue.

Sure. Use "Expression Is" as the condition, and

Time() >= [LoginTime] AND Time() <= [LogoutTime]

Note that if you're storing pure time values in these fields, then it's
ambiguous whether 11:00 am means 11:00am today, or yesterday, or eight years
ago; all Time() values are times on December 30, 1899, the base of date/time
fields. You may want to store the current DATE AND TIME using Now() in the
Logintime and Logouttime fields, and use Now() instead of Time() in the
expression.

John W. Vinson [MVP]
 

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

Top