Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002

    Question Unanswered: Problem with reports, please help !!!

    Here is the code of my problem:

    * Private Sub cmdMarges_Click()
    ' Dim db As Database
    ' Set db = CurrentDb
    ' Dim strObjectType As String
    ' Dim i, iAantal As Integer
    ' strObjectType = "Report"
    ' iAantal = db.Containers("reports").Documents.Count
    ' For i = 0 To iAantal
    ' Dim strname As String
    ' strname = db.Containers("reports").Documents(i).name
    ' DoCmd.OpenReport strname, acViewDesign
    ' DoCmd.Minimize
    ' Call SetMargins(strName, 0.25) <<<----------------------
    ' Next i

    * Public Function SetMargins(rpt As Report, sglWidth As Single)

    The problem:

    The call SetMargins doesn't work. This is due to strName is a string and rpt is a Report. How can I build this so that it works? Normally it should by like this: Call SetMargins(Reports!rptTrainingenLevYear, 0.25) but then of course I have to do this for all my reports.

    Can I use a variable after "Reports!" ?? Like this "Reports! & rpt"
    This example doesn't work but is there another possibility to get it work???

    Thanks very much for helping me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!

  2. #2
    Join Date
    Nov 2001
    Hi Luk,

    I am curious what function SetMargins(rpt As Report, sglWidth As Single) supposed to accomplish.


  3. #3
    Join Date
    Sep 2002
    It setups all the margins of all reports in the database. The margins will be set in a function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts