Results 1 to 13 of 13
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368

    Me.Picture click event


    Is it possible to detect a click on a Forms Picture ? Or failing that, a click in the title bar ?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    what is wrong with using the click event?

    Not clear whether you are talking about an image control or an image set in the forms picture property. Either way, forms and their sections all have click events as do image controls. However no click event in the title bar though you might be able to use the forms activate event if the form did not previously have the focus

  3. #3
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368
    It's an image assigned to the Forms Picture property
    I expected the click event to work, but nothing (not on d-click either)
    Have I done something wrong? The Form is Popup Yes, Modal No
    And even if I rem out the Picture = (in case that was the cause) still no response to a click.

    Code:
    Private Sub Form_Click()
    Stop
    End Sub
    
    Private Sub Form_Current()
        Me.Picture = Form_frmDisplaylA!PicsA
        Me.Caption = StripPath(Me.Picture)
    End Sub
    
    Private Sub Form_Load()
        DoCmd.MoveSize 14800, 7210, 11520, 11520
    End Sub

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    you must be doing something wrong since it works for me - I presume you do have [Event Procedure] against the form click event and you are not clicking over a control

  5. #5
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368
    Would you mind seeing if the attached works for you? There must be a reason it doesn't here, so will be very interesting.
    Thanks.
    Attached Files Attached Files

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    You need to set the click events on the form detail section, not the form?
    IIRC, the record selector or a blank area of a form is supposed to fire the click event, but I don't think I've ever got that to work on a "blank" area - not even a footer or header.
    The detail section should fire the click or dbl click event so if the pic is embedded on the form isn't that where the code should go (meaning use click or dbl click event for detail section)?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368
    Wow! Yes... I'll stop swearing at Access!
    Many thanks...

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    strange, it doesn't for me although it worked for when when I created a test form. Don't see any differences. However I got yours to work but using the detail click event

  9. #9
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Just so you know, out posts crossed and I never saw your last one so definitely didn't download your db.
    I had a bit of a rant going on here about old forum software but deleted it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368
    And now I also get Mouse Up working.
    Do you know if the coordinates for MoveSize can be obtained.
    At the moment I have
    Code:
    Private Sub Detail_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Call SysCmd(SYSCMD_SETSTATUS, X & " - " & Y)
    End Sub
    The reason being, I can resize drag the Form where I want it... but then have to 'guess' at R, D W H until I get it right. Knowing then immediately would be very helpful.

  11. #11
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    If you want it relative to the application window, that's one thing. If you want it relative to the screen, that's another. Then there is relative to the form window, which is easy enough. The others, no. Check out Mendip Data systems (Colin is a regular contributor). I seem to recall he has info there about relative coordinates to app/form/screen.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    This article & example app may help https://www.isladogs.co.uk/move-form...ols/index.html
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  13. #13
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    368
    I have read Colins article but sorry I found it hard to gleam a specific answer from it.
    Looks like MoveSize Right = 209864000 / Me.WindowLeft
    MoveSize Down = 32517100 / Me.WindowTop
    W and H is the same as Me.Window width, height

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

Similar Threads

  1. Replies: 4
    Last Post: 08-18-2021, 08:05 AM
  2. Right click event
    By bilalo in forum Programming
    Replies: 1
    Last Post: 03-06-2020, 06:28 AM
  3. Replies: 2
    Last Post: 10-09-2016, 05:41 PM
  4. Need help with click Event
    By DXXPublic in forum Programming
    Replies: 3
    Last Post: 09-23-2015, 06:55 PM
  5. Replies: 13
    Last Post: 09-10-2015, 03:37 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