View Full Version : Strange Date Problem


daveUK
07-01-2003, 08:58 AM
Hi Guys

I've created a search form that allows users to search for particular details by month, year and campus. All three are combo boxes. After the user has made their selection they click on search, this runs a query and opens a report with the details for the month and year at a particular campus. This is ok.

At the top of the report I wanted to have a message that told the user what month, year and campus the report was for. I've used the following code on the control source of a textbox.

="Satellite Report for " & Format([Forms]![FrmSatelliteSearch]![CboCampus]) & " For " & Format([Forms]![FrmSatelliteSearch]![CboMonth],"mmm") & " " & Format([Forms]![FrmSatelliteSearch]![CboYear],"yyyy")

Everything except the Year works. No matter what year I select on the search form, the year on the report is 1905!!!! :confused:

Any ideas?

Pat Hartman
07-01-2003, 07:18 PM
Why are you using the Format() function? You have not supplied any format argument for the campus field and you are using arguments for the month and year field that only properly apply to a date/time data type.

="Satellite Report for " & [Forms]![FrmSatelliteSearch]![CboCampus] & " For " & [Forms]![FrmSatelliteSearch]![CboMonth] & " " & [Forms]![FrmSatelliteSearch]![CboYear]

daveUK
07-02-2003, 06:31 AM
Thanks Pat, I used the Format() function for a similar report abd didn't realise that I didn't need it here.