
Signature
myssiwyg* ... making your support systems improve what you get!
http://www.myssiwyg.ca/
If I am reading your code correctly you are setting the txtAge control to a
string!
Me.txtAge = "Age " & DateDiff("yyyy", [CL_DOB], Date) -
IIf(Format([CL_DOB], "mmdd") > Format(Date, "mmdd"), 1, 0)
...so noe Me.txtAge is equal to the string "Age " & a number.
Then you are testing the control against a number!
If Me.txtAge > 18
...not very likely to work the way you want it to!
>I have been using code to alert user to changes that need to be made
>to a record under certain conditions in Form Current.
[quoted text clipped - 37 lines]
>Thanks.
>hro

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Linq Adams - 10 Mar 2008 02:28 GMT
Allan is correct, of course. The next question that comes to mind, after you
get this fixed, is why are you using a messagebox to instruct the user to
change data, based on the age, rather than simply changing the data thru code?

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Hilary Ostrov - 10 Mar 2008 04:49 GMT
>Allan is correct, of course. The next question that comes to mind, after you
>get this fixed, is why are you using a messagebox to instruct the user to
>change data, based on the age, rather than simply changing the data thru code?
Good question! And I actually did consider doing this ... however,
there are other fields which the user will have to manually change
because there are options that must be selected for each Adult record
which are set to "N/A" for those < 19.
Not to mention that from their existing data [some of which may not be
accurate, and all of which will require their review], it appears that
there are exceptions and at this point it is not certain that the
practice of using C and A prepended to the AR_Code will continue.
Consequently, my thinking was that the messagebox will serve as a
multi-purpose reminder to the user.
But thanks for the suggestion :)
hro

Signature
myssiwyg* ... making your support systems improve what you get!
http://www.myssiwyg.ca/
Hilary Ostrov - 10 Mar 2008 04:17 GMT
Thank you, Allan ... how could I have been so dumb as to not spot
that?! Took out the ' "Age " &', dropped "Age " into a label and it
works fine now, of course!
Thanks, again :)
Hilary
>If I am reading your code correctly you are setting the txtAge control to a
>string!
[quoted text clipped - 6 lines]
>
>..not very likely to work the way you want it to!
[...]
hro

Signature
myssiwyg* ... making your support systems improve what you get!
http://www.myssiwyg.ca/
ruralguy - 10 Mar 2008 04:26 GMT
Hi Hilary,
Glad we could be of assistance here.
>Thank you, Allan ... how could I have been so dumb as to not spot
>that?! Took out the ' "Age " &', dropped "Age " into a label and it
[quoted text clipped - 12 lines]
>
>hro

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.