Text Header displaying incorrect information

E

eschloss

Access 2003 / WinXP

I have a text box in the Page Header section of a Report (rpttest). This
text box pulls information from (2) combo boxes (Month_Combo1 and
Year_Combo1) in a Form (frmReports). The values selected from these combo
boxes (I also have a combo box for the day, fyi) form a date when combined.
Seperately, they are not date values.

When I view the Report the text box field displays "January 1905". This
happens when the selected combo box value for Month_Combo1 = "8" and
Year_Combo1 = "2008". Why is this happening? Please offer your suggestions.
Thank you.

Form Row Source for Month_Combo1:
SELECT DISTINCT Format([L_Date],"mmmm") AS Expr2, Month([L_Date]) AS Expr1
FROM L_tblDate WHERE (((Year([L_Date]))=Forms!frmReports!Year_Combo1)) ORDER
BY Month([L_Date]) DESC;

Form Row Source for Year_Combo1:
SELECT DISTINCT Year([L_Date]) AS Expr1 FROM L_tblDate ORDER BY
Year([L_Date]) DESC;

Report Control Source for Report_Date_Text:
=Format(Forms!frmReports!Month_Combo1,"mmmm") & " " &
Format(Forms!frmReports!Year_Combo1,"yyyy")
 
M

Marshall Barton

eschloss said:
Access 2003 / WinXP

I have a text box in the Page Header section of a Report (rpttest). This
text box pulls information from (2) combo boxes (Month_Combo1 and
Year_Combo1) in a Form (frmReports). The values selected from these combo
boxes (I also have a combo box for the day, fyi) form a date when combined.
Seperately, they are not date values.

When I view the Report the text box field displays "January 1905". This
happens when the selected combo box value for Month_Combo1 = "8" and
Year_Combo1 = "2008". Why is this happening? Please offer your suggestions.
Thank you.

Form Row Source for Month_Combo1:
SELECT DISTINCT Format([L_Date],"mmmm") AS Expr2, Month([L_Date]) AS Expr1
FROM L_tblDate WHERE (((Year([L_Date]))=Forms!frmReports!Year_Combo1)) ORDER
BY Month([L_Date]) DESC;

Form Row Source for Year_Combo1:
SELECT DISTINCT Year([L_Date]) AS Expr1 FROM L_tblDate ORDER BY
Year([L_Date]) DESC;

Report Control Source for Report_Date_Text:
=Format(Forms!frmReports!Month_Combo1,"mmmm") & " " &
Format(Forms!frmReports!Year_Combo1,"yyyy")

You should not be using date formats on non-date values.

I think you can just use the expression:
=Forms!frmReports!Month_Combo1.Column(0) & " " &
Forms!frmReports!Year_Combo1
 
E

eschloss

Thank you Marsh. I appreciate the "Column(0)", that would have taken me a
good bit of time to figure out!

Marshall Barton said:
eschloss said:
Access 2003 / WinXP

I have a text box in the Page Header section of a Report (rpttest). This
text box pulls information from (2) combo boxes (Month_Combo1 and
Year_Combo1) in a Form (frmReports). The values selected from these combo
boxes (I also have a combo box for the day, fyi) form a date when combined.
Seperately, they are not date values.

When I view the Report the text box field displays "January 1905". This
happens when the selected combo box value for Month_Combo1 = "8" and
Year_Combo1 = "2008". Why is this happening? Please offer your suggestions.
Thank you.

Form Row Source for Month_Combo1:
SELECT DISTINCT Format([L_Date],"mmmm") AS Expr2, Month([L_Date]) AS Expr1
FROM L_tblDate WHERE (((Year([L_Date]))=Forms!frmReports!Year_Combo1)) ORDER
BY Month([L_Date]) DESC;

Form Row Source for Year_Combo1:
SELECT DISTINCT Year([L_Date]) AS Expr1 FROM L_tblDate ORDER BY
Year([L_Date]) DESC;

Report Control Source for Report_Date_Text:
=Format(Forms!frmReports!Month_Combo1,"mmmm") & " " &
Format(Forms!frmReports!Year_Combo1,"yyyy")

You should not be using date formats on non-date values.

I think you can just use the expression:
=Forms!frmReports!Month_Combo1.Column(0) & " " &
Forms!frmReports!Year_Combo1
 

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