Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Let's make sure that you have everything. First create a label in your report's "Report Header" section and name it. "lblCaption". Next, in your report's "On Open" event, place the below.


    Code:
    Dim strHeader As String
    strHeader = InputBox("Enter your title in the box below")
    Me.lblCaption.Caption = Nz(strHeader)
    That should do it.



    Quote Originally Posted by Garito100 View Post
    Still says Object Required

  2. #17
    Garito100 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Merseyside
    Posts
    18
    I'm still getting Object Required. What does the Nz refer to? Do I have to change that?

  3. #18
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    NZ if non-zero. It's a safe-guard to cover if the user doesen't make an entry in the inputbox. Could you just upload your database?

  4. #19
    Garito100 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Merseyside
    Posts
    18
    I don't think I can upload it, it's massive and has lots of sensitive data in it. Here is the script I am using:

    Private Sub Report_Open(Cancel As Integer)
    Dim strHeader As String
    strHeader = InputBox("Enter your title in the box below")
    SignSheet.lblCaption.Caption = Nz(strHeader)
    End Sub

    lblCaption is the name of the label.

  5. #20
    Garito100 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Merseyside
    Posts
    18
    Eureka!

    SignSheet is the name of the report. I got rid of that from the script and just started with lblCaption ....... and it has worked!

    Thanks to everyone who helped!

  6. #21
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Glad you got it working.

    Quote Originally Posted by Garito100 View Post
    Eureka!

    SignSheet is the name of the report. I got rid of that from the script and just started with lblCaption ....... and it has worked!

    Thanks to everyone who helped!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-22-2010, 08:30 PM
  2. Title Label In Subforms
    By vCallNSPF in forum Reports
    Replies: 4
    Last Post: 12-08-2009, 06:20 PM
  3. Replies: 0
    Last Post: 06-14-2009, 06:18 PM
  4. Problems adding a drop down box to report/query
    By rachelm920 in forum Access
    Replies: 1
    Last Post: 05-14-2009, 09:19 AM
  5. Adding rows on cross-tab query report
    By KahluaFawn in forum Reports
    Replies: 2
    Last Post: 02-18-2009, 10:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums