Reports Description Field

F

FM

I am trying to pull the Description of a report, but I
can seem to find the right syntax to include in the
Visual Basic. The description field that I am looking
for can be found when are in the main Access screen and
you right-click on any report name and then go to
Properties. I can pull up the date-created, date-
modified, etc that is also found on that screen, but not
the Description that can be typed in. Thanks in advance.

FM
 
M

Marshall Barton

FM said:
I am trying to pull the Description of a report, but I
can seem to find the right syntax to include in the
Visual Basic. The description field that I am looking
for can be found when are in the main Access screen and
you right-click on any report name and then go to
Properties. I can pull up the date-created, date-
modified, etc that is also found on that screen, but not
the Description that can be typed in

CurrentDb.Containers("Reports").Documents(Me.Name).Properties("Description")
 
M

Marshall Barton

FM said:
I am trying to pull the Description of a report, but I
can seem to find the right syntax to include in the
Visual Basic. The description field that I am looking
for can be found when are in the main Access screen and
you right-click on any report name and then go to
Properties. I can pull up the date-created, date-
modified, etc that is also found on that screen, but not
the Description that can be typed in.

In response to private email.

You're right, the description property does not exist until
you enter something into it using Access UI or your own
code. The usual way around this is for your code to trap
whatever error that is and use an empty string.


On Error GoTo ErrorHandler
. . .
Me.lstReports.ControlTipText = CurrentDb.Containers( . . .
. . .
ExitHere:
Exit Sub

ErrorHandler:
Select Case Err.Number
Case 3270
Me.lstReports.ControlTipText = "No Descri[tion"
Resume Next
Case Else
MsgBox Err.Number & " - " & Err.Description
Resume ExitHere
End Select
End Sub
 

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