#ERROR on report due to a date textbox

spnz

Registered User.
Local time
Today, 09:39
Joined
Feb 28, 2005
Messages
84
Hi all......Happy easter!!!

I have a report that Im having a few problems with trying to get to work the way I need it to.

This is my a controlsource value I am trying to get working.

=[Forms]![RegistrationForm]![forename]+" "+"is employed by blablabla LTD as a scubadiver."+" "+[Forms]![RegistrationForm]![FORENAME]+" "+"begin working for blablabla LTD on a contract service basis on the"+[Forms]![RegistrationForm]![StartDate]


It all works fine until I add the last part of it [Forms]![RegistrationForm]![StartDate]. I have tried placing this in its own textbox and it works fine but when I try add it to the first controlsource I get the #ERROR showing on the report.

Is there something I am doing wrong??
 
Report

May be it's because you try to concatenate 2 different data types.
I suppose [Forename] = text and [Date] = Date type.
 
Yes your right.

Is this not possible??

Sorry if this is a basic question.
 
Report

Probably the easiest solution is to put a hidden textbox on the Registration Form, name it something like: HiddenDate.
In the Control Source put: =Str([StartDate])
Now you have converted StartDate to a text string.

And then change the control source on the report to:

=[Forms]![RegistrationForm]![forename]+" "+"is employed by blablabla LTD as a scubadiver."+" "+[Forms]![RegistrationForm]![FORENAME]+" "+"begin working for blablabla LTD on a contract service basis on the"+[Forms]![RegistrationForm]![HiddenDate]

Hope this works. Happy Easter.
 
Sometimes the concatenation operator can get you into trouble. You are using + which is also a mathematic operator, whilst it is often more recommended to use ampersand (&) for text concatenetion. You may also want to try to explicitly format the date to a string (since a date is a number), i e

...basis on the" & format$([Forms]![RegistrationForm]![StartDate],"mm/dd/yyyy")
 
Thanks Trucktime & RoyVidar

I managed to get the report working the way I want it to with both of your help.


Have a great easter!
 

Users who are viewing this thread

Back
Top Bottom