Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Report Caption

Status
Not open for further replies.

OOzy

Programmer
Jul 24, 2000
135
SA
I am trying to format the report caption to look like

20051109 - Action Items
YYYYMMDD - Action Items

using the code below but I am getting a compile error:can't find project or library. Also the word Format gets highlighted

Please help!
Code:
Private Sub Report_Open(Cancel As Integer)
Dim RC As Variant

RC = [highlight]Format[/highlight](Now(), "YYYYMMDD") + "-Action Items"

Report.Caption = RC
End Sub
 
OOzy
The Format part is correct. To check that, just use your code without the + "(-Action Items)" part.

I think your problem lies with that piece of the line. Try changing the + sign to an ampersand (&).
RC = Format(Now(), "YYYYMMDD") + "-Action Items"

RC = Format(Now(), "YYYYMMDD") & "-Action Items"

or
RC = Format(Now(), "YYYYMMDD") & ( + "-Action Items")
if you want this to go away if null.


Tom
 
I think this is a references issue. If Tom's suggestion doesn't work, check this link
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
This topic also appears at:
Format Report Caption
thread705-1148944
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top