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

Code Builder on Text Box . . .how? 1

Status
Not open for further replies.

dpav29

Technical User
Aug 3, 2001
155
US
Hi folks,

I'm hoping this is easy, but I can't find it anywhere.

I want to use code builder, but can only access expression builder for a text-box. I wouldn't mind using expression builder if I new the equivalent to this:

If [frequency]= "Annual" Then
DateAdd("m",12,[DueDate])
ElseIf [frequency]="Quarterly" Then
DateAdd("m",3,[DueDate])
Else
DateAdd("m",6,[DueDate])

End if

As you probaly guessed, I need to add the next due date each time a check is received (some annually, quarterly, bi-annual).

Any help is much appreciated as always.
 
In the AfterUpdate event procedure of frequency, you may add this code:
[next due date] = DateAdd("m", IIf([frequency]= "Annual", 12, IIf([frequency]= "Quarterly", 3, 6)), [DueDate])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
As PVH stated, the code builder can be found in any of the events.
 
Thanks for the posts! I didn't think of that because there are no events specific to the frequency field. . it is static and can't be updated at the form level. However, I think I'll try that on the form's open or load event. Thanks for pointing me in the right direction!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top