Results 1 to 14 of 14
  1. #1
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13

    Moving an image in a grouped header

    Hi,

    I'm totally new to access, and need a little help on how to tweak an images location every time an instance of "GroupHeader0" is rendered. So the same image needs to be possibly in different locations. But only tweaked in the Y axis.

    I place the code in "On Paint"

    and the code I am using to test with is;

    Code:
    Private Sub GroupHeader0_Paint()
    
        Me.imgVFF.Left = 2880
    
    
    End Sub
    also I've used below;



    Code:
    Private Sub GroupHeader0_Paint()
        
        Dim rpt As Report
        Set rpt = Reports!projects
        rpt.imgVFF.Left = 2880
    
    
    End Sub
    Either way I get; "The setting you entered isn't valid for this property".

    consequently I can do the following, and get a number out of it.

    Code:
    Debug.Print Me.imgVFF.Left
    a little confused, any ideas?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    There’s no need for
    :Dim rpt As Report Set rpt = Reports!projects

    you are already IN the report. No need to make another.

    so it is: Img.left

    DONT put it in PAINT.
    put it in ON PRINT.

  3. #3
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    Quote Originally Posted by ranman256 View Post
    so it is: Img.left.
    Changed to;

    Code:
    Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
    
    
        Me.imgVFF.Left = 1440
    
    
    End Sub
    Still the error persists. Perhaps it's something to do with the project. I'll try to create a blank project and test it this way.

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    You need use the move action
    https://learn.microsoft.com/en-us/of...ess.image.move

    Me.imgVFF.Move 1440


    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    Quote Originally Posted by Minty View Post
    You need use the move action
    https://learn.microsoft.com/en-us/of...ess.image.move

    Me.imgVFF.Move 1440
    Thanks, but I get the same exact error.. something else is at play here.

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    What type of control is imgVFF ?

    Can you upload a simple sample database to have a look at?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    I created a blank database, and attached it here..

    I get the same error as before..

    for inserting the image I used this congrol

    Attached Files Attached Files

  8. #8
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    It has to be approved by a moderator, but it's coming.
    Attached Files Attached Files

  9. #9
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    See message above

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Post 7 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    Within a grouped header. I just plopped it in format. I'm able to instill change in the image location now.

    Code:
    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
        Me.imgVFF.Left = Int((12960 * Rnd) + 1)
    End Sub

  12. #12
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    Apologies I missed your upload.

    Glad you have sorted it, and thanks for posting back the solution.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  13. #13
    KillGorack is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2022
    Posts
    13
    Quote Originally Posted by Minty View Post
    Apologies I missed your upload.

    Glad you have sorted it, and thanks for posting back the solution.

    I'd mark this one solved... if I knew how..

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by KillGorack View Post
    I'd mark this one solved... if I knew how..
    It's in Thread Tools in the green bar above the first post.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 07-10-2020, 12:41 PM
  2. Replies: 8
    Last Post: 10-26-2016, 02:36 PM
  3. Grouped field header on report
    By Glenn_Suggs in forum Reports
    Replies: 2
    Last Post: 05-16-2013, 06:33 AM
  4. Help! Header Logo Image on form won't print.
    By DjMorgan in forum Access
    Replies: 8
    Last Post: 04-29-2013, 06:46 AM
  5. Replies: 9
    Last Post: 04-21-2013, 05:37 PM

Tags for this Thread

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