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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having a problem with this string any suggestions?

Status
Not open for further replies.

NeoZakz

Technical User
Jul 22, 2002
25
0
0
US
I'm using this string here to do a date update for a form in a subform.

If Me![Combo119] Is Not Null Then Me![Date Due] = DateAdd("d", Me![Seq], Me![miledate])

The problem is the first part of the string says it needs an object, "If Me![Combo119] Is Not Null Then". Everything I've put in there for an object doesn't seem to satisfy it anyone have any suggestions on how to fix this?
 
Instead of
If Me![Combo119] Is Not Null Then Me![Date Due] = DateAdd("d", Me![Seq], Me![miledate])
Try
If Not IsNull([Me!Combo119]) Then Me![Date Due] = DateAdd("d", Me![Seq], Me![miledate])
 
If Is Not Null([Me!Combo119]) Then Me![Date Due] = DateAdd("d", Me![Seq], Me![miledate]) still gives me an error on the Is Not Null part, had to change it around to this before it would accept. If Is Not Null Then Me![Date Due] = DateAdd("d", Me![Seq], Me![miledate]).
 
I may be wrong but you seem to have misunderstood RobertT687's suggestion.
He suggested the test
If Not IsNull(yourcontrol)
IsNull() is a function which accepts a variant (basically any value) and tests it. If the value is the null value IsNull() returns the value True , otherwise it returns the value False.
You put the Not in front of it to change True to False and vice versa. The only problem I can see with the proposed solution is a typo
[Me!Combo119] should be Me![Combo119]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top