Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Syntax Help Again (2000)

    Hi,
    I have the following code below. It was working great, but then I've had to make a table design so I had to change the lngVendor ID which was a number data type to txtPRNo which is a text data type and now it won't work. Basically the code says if I have more than 6 records show this subreport. My report works great when I have less than 6 but if I have more it just prints page 1 and it should print Page 1 and 2. I'm thinking because I'm switching to a text field I have to have different VBA syntax so it will count correctly.
    Any thoughts?
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.srptPRPartsSubreportRestExistMech.Visible = _
    (DCount("*", "qryPRSubreportExistMech", "lngVendorID=" & Me.lngVendorID) > 6)
    Me.PageBreak212.Visible = Me.srptPRPartsSubreportRestExistMech.Visible
    End Sub

    Thanks,
    Deb

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Syntax Help Again (2000)

    As lngvendorID is becoming a text field, you have to surround it with quotes :
    <pre>Me.srptPRPartsSubreportRestExistMech.Visibl e = _
    (DCount("*", "qryPRSubreportExistMech", "lngVendorID='" & Me.lngVendorID & "'") > 6)</pre>

    Francois

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Syntax Help Again (2000)

    That seems to be the trick. Thank you very much!!!

    Deb

Posting Permissions

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