ControlSource Property

clark

New member
Local time
Today, 06:39
Joined
Mar 1, 2002
Messages
6
I put an expression in the controlsource property and I want that value to show up in the underlying database in the appropriate field. I can't believe it is not set up to do so automatically. Any recommendations, or do I have to write code?

O.K., let's see, I created a form based on the database. I put an expression in the controlsource property to subtract two dates and put the result in the field, works fine. But, I read in the help section that the value is not stored in the database, it is read only and I need to store the value in the database. I can write code but that would take forever.

[This message has been edited by clark (edited 03-01-2002).]
 
you cannot believe it? well you had better bud!, any ideas to what the code is, also what do you mean underlying database?

What are you trying to acheive, if your going to post a question try to add as much detail as possible.
 
Why are you trying to store a calculated result? Unless the dates will change at a later date, you can recalculate this value at any point. If you need it other places than just the form, put the calculation in your query behind the form.
CalField: DateDiff("d",[Date1Field],[Date2Field])
Then you can set the ControlSource to [CalField]. If you set it to =DateDiff("d",[Date1Field],[Date2Field]) then it is a CALCULATED field and you cannot save that result without code.

HTH,
David R
 

Users who are viewing this thread

Back
Top Bottom