Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Forms!MyForm.Visible = True not working


    I have a form (it's a sub-form actually) that includes a combobox where property choices are shown as pertains the contents of an image. The form ("frmImSample") that contains ONLY an image control has that control's Picture property set to the current records image name and the intent here is to simply make the image visible while the user makes his/her choice among the property options. The "image form" is then made invisible when the combobox looses the focus. The "make visible" statement is not working and I've not figured out why that is. (I verified the image form is open in Debug)
    Code:
    Private Sub cboHowPic_GotFocus()
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  Combo box shows the available list of properties for the Directory image.
    '  Popup the image itself so that the user can see who's in the image.
    '  (Open the image form first if it's not already open.)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    Call ShiftPB
    
    
    If Not IsNull(FamilyImageID) Then
        Me.cboHowPic.Dropdown
        
        If CurrentProject.AllForms("frmImSample").IsLoaded = False Then _
            DoCmd.OpenForm "frmImsample", , , , , acHidden
        
        Forms!frmImSample!ImSample.Picture = TMSClientPath & TMSClientImages & FamilyImageID & ".jpg"
        Forms!frmImSample.Visible = True            '<<<<<<<<<<<<<<<<<<<<
    End If
    
    
    End Sub
    
    
    Private Sub cboHowPic_LostFocus()
    Forms!frmImSample.Visible = False
    
    
    End Sub

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    just minimize it. kinda hidden.
    then maximize it to make it visible.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Comment out the lost focus code to see if it's firing.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Didn't matter. I don't know how to try Ranman256's idea, as there's no code running there so that a DoCmd.Minimize/Restore can be executed. I don't know how to do that from one form's module to another form.

    EDIT: Will the statement "Forms!frmImSample!ImSample.Picture = TMSClientPath & TMSClientImages & FamilyImageID & ".jpg"" cause one of its events to fire? If so, I could then run code in the "image form's" module.

    Note: I'm running Colin's "hidden access window" with this app, so perhaps I'm not following his protocol correctly in this situation?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why have the image on a popup form instead of image control on the primary form?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Yes, that would be ideal and that was my first idea, but the only place for it is on top of the continuous sub-form that dominates most of the form's real estate. If you know how to share that real estate between a sub-form container and an image control I'm all ears.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Only way I know would be a Tab control.

    How big does this image display need to be? No space in the main form header?

    I doubt setting Picture property will trigger an event.

    I have never used Picture property for dynamic display of images. I use Image control ControlSource.
    https://www.accessforums.net/showthread.php?t=65686
    https://www.accessforums.net/showthread.php?t=73766
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    The image control is 5" x 3.85". Maybe I could start with a smaller image control and change its size dynamically and move it where it needs to be? Not sure what the impact on the sub-form container would be if I attempted such a thing. I'm still wanting to understand why the OP can't be solved, I continue to ponder.

    I do understand your point about a Tab control, but the UI wouldn't likely be well accepted by the users I know about.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Did you make sure the lost focus code wasn't running and hiding it again?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Yes, I posted that in #4.

    It's too bad I can't MOVE containers around so I could share some of the form's real estate. The image control could just as well be in a sub-report, but I don't think that would change anything.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Setting form Visible property works for me.

    You step-debugged?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I must not be in compliance with the functions provided by Colin where I'm hiding the access window. Notice in the code below that I make the form visible and then test its visibility state. In the first opening of the parent, the sub-form in fact displays as expected. However, on subsequent instances of the GotFocus event of the combo, while the "Msgbox" tells me that the form is visible, it IS IN FACT NOT visible.

    Code:
    Private Sub cboHowPic_GotFocus()
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  Combo box shows the available list of properties for the Directory image.
    '  Popup the image itself so that the user can see who's in the image.
    '  (Open the image form first if it's not already open.)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    Call ShiftPB
    
    
    If Not IsNull(FamilyImageID) Then
        
        If CurrentProject.AllForms("frmImSample").IsLoaded = False Then _
            DoCmd.OpenForm "frmImsample", , , , , acHidden
        
        Forms!frmImSample!ImSample.Picture = TMSClientPath & TMSClientImages & FamilyImageID & ".jpg"
        Forms!frmImSample.Form.Visible = True
        MsgBox Forms!frmImSample.Form.Visible
    
    
        Me.cboHowPic.Dropdown
    End If
    
    
    End Sub

    AS AN ASIDE: Does anyone know why one does not get notification emails when a posting gets updated? I've received none during the progression of this thread. I've not changed any of my settings.

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I tested code and works for me.

    Could the image form be open and visible but behind the other form?

    You're not the only one who's mentioned issue about notifications https://www.accessforums.net/showthr...t=notification
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Could the image form be open and visible but behind the other form?
    Yes, one of the first things I suspected, though I haven't tried looking lately with the various changes I've made.......... be back in a flash.

    EDIT: YES!!! The 1st of the GotFocus instances has the image ON TOP, but a 2nd instance has it hidden behind the sub-form that contains the combobox. I haven't a clue how to fix that.

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can set the image form as Modal in design. When it is not visible can interact with other form but as soon as it is visible the Modal aspect engages and form pops to front and can't do anything with other forms until image form is closed or made not visible.

    I am not sure GotFocus event is the best one for what you are trying to do.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-12-2019, 08:52 AM
  2. On Field Change, Visible = True
    By wtucker in forum Access
    Replies: 20
    Last Post: 04-25-2018, 12:11 PM
  3. Replies: 1
    Last Post: 03-27-2016, 10:29 PM
  4. Visible - Not Visible Macro Not Working?
    By euphonium01 in forum Macros
    Replies: 3
    Last Post: 07-08-2015, 02:20 AM
  5. visible form but not have focus when true
    By Ruegen in forum Programming
    Replies: 5
    Last Post: 04-30-2015, 10:31 AM

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