Executing code in a Textbox

J

Jim

I want to call a function from a Textbox in a report. Specifically
DateDiff("m",<Date1>,<Date2>) to get the number of months difference between
two date fields. This doesn't seem to work when I type the code in the
Expression Builder window. Haven't tried writing a function to call from Exp
Builder, but it looks like the Exp Builder will only parse functions that it
knows about.

I don't work in Access much but done a lot with various VB incarnations.

Jim Benson
 
A

Allen Browne

The expression must start with =.

For example, set the Control Source property of your text box to:
=DateDiff("m",[InvoiceDate],[PaymentDate])
where InvoiceDate and PaymentDate are the date fields in the report's
RecordSource.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top