control source problem

Rosebud

Registered User.
Local time
Today, 03:28
Joined
Dec 5, 2000
Messages
28
Hi,

I've searched the forum for a solution to my problem, but nothing I've found helped so ....

I'm trying to assign a control source to a control on my form at run-time, but I can't get it to work. This is the idea I'm going for:

txt24.controlsource = "=DateAdd("m", -1,date())"

but this gives me error (the "m" messes it up). Then I tried

s = "m"
txt24.ControlSource = "=Dateadd(s,1,date())"

but no luck either. Can anyone see what I am doing wrong?

[This message has been edited by Rosebud (edited 04-05-2001).]
 
You can't do it that way use =DateAdd("m",-1,Date()), in the property sheet or Me.txt24 = DateAdd("m",-1,Date())in the load /open event.
HTH
 
Thanks Rich, that worked nicely.
 

Users who are viewing this thread

Back
Top Bottom