Text Box Dillemma

Les

Registered User.
Local time
Today, 05:44
Joined
Nov 20, 2002
Messages
45
Can a text box have an expression and be bound to a field?

The problem I'm having is that the value of the expression in a text box cannot be changed or overriden.

If there is another way please let me know.
 
Generally speaking, it's not good database practice to write calculated values into your tables. Only raw data should be stored in Tables; calculated data should be derived with queries and expressions for end use in forms and reports.

I tried using the example in the article you linked to and while it worked, it has serious drawbacks:

Setting the events in your form and controls to a macro really restricts your ability to add any other functionality to the form that you might need.

I would strongly suggest that you don't need to write the calculated value to your table.

HTH,
John
 
Thanks for the suggestion. However, I need to be able to query out records based on the textboxes with expression for monthly billing.

The fom I've created is a Billing form that breaksdown when the dates of the payments based on [FirstPaymentDue] by using

DateAdd("m",1,[FirstPaymentDue]) 'for the second month
DateAdd("m",2,[FirstPaymentDue]) 'for the third ... etc

If you can suggest a better way please do.
 
Build a select query with the table fields that you need, then add calculated fields to the query equal to your expressions. Then base your form on this query (use the query as the RecordSource for your form). Set the ControlSource for your text boxes to the calculated field names.

;)
 
If it was a snake i'd be dead.
thank you!
 

Users who are viewing this thread

Back
Top Bottom