Results 1 to 9 of 9
  1. #1
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25

    Forcenew page ...


    Having a moment ....
    OK I have a subreport and I have added in a yes/no field called
    newpage
    what I want is when it is true (-1) then forcenewpage otherwise ignore it

    So I started with :
    If me.newpage = true then forcenewpage

    etc...

    but does not like this ..


    I know it is going to be something simplies ...
    regards

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    have you googled 'forcenewpage' to find out out how to use it? From the code you provided it would appear not. here is the link https://docs.microsoft.com/en-us/off...n.ForceNewPage.

  3. #3
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    ok replies don't seem to be working ..

    Should it not be
    If newpage=true then forcenewpage=1 etc..
    else
    I had looked the MS page ,, not overly helpful

  4. #4
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    If Me.newpage = True Then
    Me.Detail.ForceNewPage = 1
    End If

    If Me.newpage = False Then
    Me.Detail.ForceNewPage = 0

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    so does that work or not? which event are you using?

    also code could be simpler

    Me.Detail.ForceNewPage =abs(Me.newpage)

  6. #6
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    Quote Originally Posted by Ajax View Post
    so does that work or not? which event are you using?

    also code could be simpler

    Me.Detail.ForceNewPage =abs(Me.newpage)


    Sorry Ajax (for the late response)
    my version works for its purpose (at the moment.. ) - when its getts into the real world it might change - I like the look of your coding its "cleaner" I will test both out in a real enviroment ..
    thank you for your response I was having a real "Monday"

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Another approach is to insert a page break and then either show it or don't, based on some value. Could be as simple as true/false or a value that counts the number of records in a group. IIRC, that is controlled in the format event.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    Quote Originally Posted by Micron View Post
    Another approach is to insert a page break and then either show it or don't, based on some value. Could be as simple as true/false or a value that counts the number of records in a group. IIRC, that is controlled in the format event.

    ha
    that was my first approach.. maybe because it was a sub report

    I had
    If me.newpage (name of control) = true then pagebreak4.visible=true
    else .....
    it did like it or did not work

    but that was my go to solution to begin with

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Where you put the code matters as not all report events run for each view. Maybe that was your issue but you didn't answer that from post 5 so that's a guess.
    If you got it working but that changes down the road, you can always post here again.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-03-2017, 02:46 PM
  2. Replies: 4
    Last Post: 12-14-2016, 11:07 AM
  3. Replies: 1
    Last Post: 11-15-2016, 02:14 PM
  4. Replies: 1
    Last Post: 11-11-2016, 07:02 PM
  5. Replies: 3
    Last Post: 05-11-2015, 12:35 PM

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