Strange Date Problem (1 Viewer)

daveUK

Registered User.
Local time
Today, 23:04
Joined
Jan 2, 2002
Messages
234
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

Super Moderator
Staff member
Local time
Today, 18:04
Joined
Feb 19, 2002
Messages
43,457
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

Registered User.
Local time
Today, 23:04
Joined
Jan 2, 2002
Messages
234
Thanks

Thanks Pat, I used the Format() function for a similar report abd didn't realise that I didn't need it here.
 

Users who are viewing this thread

Top Bottom