It will not be easy, I think...

G

Guest

Hi!

I have a continuous form with 4 textboxes:
Timer1, String1, Timer2 and String2
Timer2=Timer1

Ex:
08:00 hyj 08:00 xpto1
....
08:54 lku 08:54 xpto2
08:55 rty 08:55 xpto3
08:56 poi 08:56 xpto4
08:57 WWW 08:57 xpto5 <-
08:58 ghv 08:58 xpto6
08:59 mjn 08:59 xpto7
09:00 cfr 09:00 WWW <----- (String2, RED)
09:01 fdc 09:01 xpto8
09:02 bvg 09:02 xpto9
09:03 ght 09:03 xpto10
09:04 WWW 09:04 xpto11 <-
09:05 ply 09:05 xpto12
09:06 cxz 09:06 xpto13
....
22:00 xyz 22:00 xyz

I need for Conditional Formatting in textbox, of the String2, to next:
If String2=String1 And
hour in Timer1
beetween
hour of the Timer2 - 00:05 Or
hour of the Timer2 + 00:05

Where, in this example:
String2 (09:00)=String1(08:57) Or String1(09:04)

Thanks in advance for any help.
an
 
G

Guest

An,

Assuming fieldnames Timer1, String1, Timer2, and String2 and corresponding
textboxes txtTimer1, txtString1, txtTimer2, and txtString2, set the the
Criteria for conditional formatting to "Expression Is"

Not IsNull(DLookUp("[Timer1]","TimerString","[String1] = [txtString2]")) And
DateDiff("n",[txtTimer2],DLookUp("[Timer1]","TimerString","[String1] =
[txtString2]")) Between -5 And 5

You will also need to recalculate if any of the values are changed:

Me.Recalc

Hope that helps.

Sprinks
 
G

Guest

S,
Thank you for reply.
(My last reply for you is not posted)

Please, what is "TimerString"?
The color don't change.

an

Sprinks said:
An,

Assuming fieldnames Timer1, String1, Timer2, and String2 and corresponding
textboxes txtTimer1, txtString1, txtTimer2, and txtString2, set the the
Criteria for conditional formatting to "Expression Is"

Not IsNull(DLookUp("[Timer1]","TimerString","[String1] = [txtString2]")) And
DateDiff("n",[txtTimer2],DLookUp("[Timer1]","TimerString","[String1] =
[txtString2]")) Between -5 And 5

You will also need to recalculate if any of the values are changed:

Me.Recalc

Hope that helps.

Sprinks


an said:
Hi!

I have a continuous form with 4 textboxes:
Timer1, String1, Timer2 and String2
Timer2=Timer1

Ex:
08:00 hyj 08:00 xpto1
...
08:54 lku 08:54 xpto2
08:55 rty 08:55 xpto3
08:56 poi 08:56 xpto4
08:57 WWW 08:57 xpto5 <-
08:58 ghv 08:58 xpto6
08:59 mjn 08:59 xpto7
09:00 cfr 09:00 WWW <----- (String2, RED)
09:01 fdc 09:01 xpto8
09:02 bvg 09:02 xpto9
09:03 ght 09:03 xpto10
09:04 WWW 09:04 xpto11 <-
09:05 ply 09:05 xpto12
09:06 cxz 09:06 xpto13
...
22:00 xyz 22:00 xyz

I need for Conditional Formatting in textbox, of the String2, to next:
If String2=String1 And
hour in Timer1
beetween
hour of the Timer2 - 00:05 Or
hour of the Timer2 + 00:05

Where, in this example:
String2 (09:00)=String1(08:57) Or String1(09:04)

Thanks in advance for any help.
an
 
G

Guest

An,

My apologies; the parameters of the Dlookup function are 1) the field to
retrieve, 2) the domain (table or query) in which to look, and 3) a criteria
clause. Replace TimerString in two places with the name of your table.

Also, you will need to change the fieldname and textbox name references if
they are different than what I assumed.

Sprinks

an said:
S,
Thank you for reply.
(My last reply for you is not posted)

Please, what is "TimerString"?
The color don't change.

an

Sprinks said:
An,

Assuming fieldnames Timer1, String1, Timer2, and String2 and corresponding
textboxes txtTimer1, txtString1, txtTimer2, and txtString2, set the the
Criteria for conditional formatting to "Expression Is"

Not IsNull(DLookUp("[Timer1]","TimerString","[String1] = [txtString2]")) And
DateDiff("n",[txtTimer2],DLookUp("[Timer1]","TimerString","[String1] =
[txtString2]")) Between -5 And 5

You will also need to recalculate if any of the values are changed:

Me.Recalc

Hope that helps.

Sprinks


an said:
Hi!

I have a continuous form with 4 textboxes:
Timer1, String1, Timer2 and String2
Timer2=Timer1

Ex:
08:00 hyj 08:00 xpto1
...
08:54 lku 08:54 xpto2
08:55 rty 08:55 xpto3
08:56 poi 08:56 xpto4
08:57 WWW 08:57 xpto5 <-
08:58 ghv 08:58 xpto6
08:59 mjn 08:59 xpto7
09:00 cfr 09:00 WWW <----- (String2, RED)
09:01 fdc 09:01 xpto8
09:02 bvg 09:02 xpto9
09:03 ght 09:03 xpto10
09:04 WWW 09:04 xpto11 <-
09:05 ply 09:05 xpto12
09:06 cxz 09:06 xpto13
...
22:00 xyz 22:00 xyz

I need for Conditional Formatting in textbox, of the String2, to next:
If String2=String1 And
hour in Timer1
beetween
hour of the Timer2 - 00:05 Or
hour of the Timer2 + 00:05

Where, in this example:
String2 (09:00)=String1(08:57) Or String1(09:04)

Thanks in advance for any help.
an
 
G

Guest

S,

Finally, work fine!

Thank you for your help.
an

Sprinks said:
An,

My apologies; the parameters of the Dlookup function are 1) the field to
retrieve, 2) the domain (table or query) in which to look, and 3) a criteria
clause. Replace TimerString in two places with the name of your table.

Also, you will need to change the fieldname and textbox name references if
they are different than what I assumed.

Sprinks

an said:
S,
Thank you for reply.
(My last reply for you is not posted)

Please, what is "TimerString"?
The color don't change.

an

Sprinks said:
An,

Assuming fieldnames Timer1, String1, Timer2, and String2 and corresponding
textboxes txtTimer1, txtString1, txtTimer2, and txtString2, set the the
Criteria for conditional formatting to "Expression Is"

Not IsNull(DLookUp("[Timer1]","TimerString","[String1] = [txtString2]")) And
DateDiff("n",[txtTimer2],DLookUp("[Timer1]","TimerString","[String1] =
[txtString2]")) Between -5 And 5

You will also need to recalculate if any of the values are changed:

Me.Recalc

Hope that helps.

Sprinks


:

Hi!

I have a continuous form with 4 textboxes:
Timer1, String1, Timer2 and String2
Timer2=Timer1

Ex:
08:00 hyj 08:00 xpto1
...
08:54 lku 08:54 xpto2
08:55 rty 08:55 xpto3
08:56 poi 08:56 xpto4
08:57 WWW 08:57 xpto5 <-
08:58 ghv 08:58 xpto6
08:59 mjn 08:59 xpto7
09:00 cfr 09:00 WWW <----- (String2, RED)
09:01 fdc 09:01 xpto8
09:02 bvg 09:02 xpto9
09:03 ght 09:03 xpto10
09:04 WWW 09:04 xpto11 <-
09:05 ply 09:05 xpto12
09:06 cxz 09:06 xpto13
...
22:00 xyz 22:00 xyz

I need for Conditional Formatting in textbox, of the String2, to next:
If String2=String1 And
hour in Timer1
beetween
hour of the Timer2 - 00:05 Or
hour of the Timer2 + 00:05

Where, in this example:
String2 (09:00)=String1(08:57) Or String1(09:04)

Thanks in advance for any help.
an
 

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