Results 1 to 11 of 11
  1. #1
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78

    Make form Visible in a Navigation pane


    I have a Menu form (picture attached) - so you
    1) click on Finish an Incomplete Request
    2) Select the request from the dropdown
    3) Make the form visible so they can edit.

    What's happening is that in my code I was originally using an OpenForm command and it's opening the form in a new tab, but what I want is to make the form visible with the filter in place. Where do I need to change my code to do this?

    Code:
    Private Sub cboSelectInc_AfterUpdate()
     
        Dim ProjNo As String
        Dim ProjFilter As String
     
        ProjNo = Me.cboSelectInc
        ProjFilter = "txtProjectNumber = '" & ProjNo & "'"
     
        DoCmd.OpenForm "frmIncRequestsQ", acNormal, "FilterInc", ProjFilter
        Forms![frmIncRequestsQ].Visible = True
       
        DoCmd.Close acForm, "MainMenu" 
     
    End Sub
    Attached Thumbnails Attached Thumbnails image002.png  

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    not sure what you mean by 'make the form visible with filter in place'. Do you mean as a popup?

    don't know what FilterInc is, it should be a query

    but all you should need is

    DoCmd.OpenForm "frmIncRequestsQ", acNormal, "FilterInc", "txtProjectNumber = '" & Me.cboSelectInc & "'"

    and if you want to open as popup


    DoCmd.OpenForm "frmIncRequestsQ", acNormal, "FilterInc", "txtProjectNumber = '" & Me.cboSelectInc & "'",,acDialog

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Why not just use the query to filter to whatever the filter is doing?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    I don't understand what you mean about the query filter....

    The unbound box is the cboSelectInc which allows the user to select the estimate to continue working on - in the AfterUpdate Event I have the code to open the form to the selected estimate and this works fine in opening the form to the correct record using the filter. By the way, I updated the code to the suggested DoCmd.OpenForm "frmIncRequestsQ", acNormal, "FilterInc", "txtProjectNumber = '" & Me.cboSelectInc & "'" and it gives me the same results in opening the form separately instead of in the same form.

    Let me explain: Under the "Finish an Incomplete Request" drop down, I added the form that I want to "make visible" so the form is sitting there I just want it to become visible to the selected record instead of opening separately on a different tab. I think the issue is in the DoCmd.OpenForm, I tried to add a code to Forms![frmIncRequestsQ].Visible=True before the OpenForm event and it doesn't work either.

    Is this doable?

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I think you're describing a subform situation. Not sure why you'd show so little of the form if that's what you're trying to make visible. In that case, you don't open this form, you hide and unhide the subform control.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Click image for larger version. 

Name:	image002 (1).png 
Views:	11 
Size:	63.9 KB 
ID:	46599Click image for larger version. 

Name:	image001 (1).png 
Views:	10 
Size:	61.0 KB 
ID:	46600

    These are the screenshots, I basically dragged the form into the other form. Should I be changing the default view? How do I un/hide the control while still filtering?

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    In design view change the subform control visible property to no. Open then filter the subform then unhide the control and see what you get for records. Close form and repeat with a different filter and see what you get. If you cannot filter the form then unhide it and show the records you want I'll be surprised. No need to change the default view of the subform for this.

    Not real sure what's going on yet. Posts 2 and 5 indicate some uncertainty about the requirement and I don't think they've been addressed. I don't want to take you down the wrong path with this visible/invisible subform thing if that isn't the issue.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    How do I un/hide the control while still filtering?
    you use the visible property of the subform

    instead of docmd.openform you use me.[Estimate Request Form].visible=true

    Note that making a subform control visible does not requery the form object it contains. There are a number of ways this can be done but the easiest is to set the subform linkmaster property to cboSelectInc and the linkchild property to FilterInc then no code is required

    Note having spaces in object (such as fields, controls, tables, forms, reports) names is a bad idea, requires extra typing and increases the opportunity for errors. You will be told this pretty much every time you post a question. For example in your first post you close form "MainMenu" but the form is actually called either "Main Menu" or "Main_Menu" - sometimes access will replace a space with and underscore.

  9. #9
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    I was able to fix the issue with the form actually appearing with the Me.Estimate_Request_Form.Visible = True however, I couldn't connect it to cboSelectInc because the only options are the actual field names, the cboSelectInc is unbound and contains two fields, number & title but only the title is viewable. Is that something I can do in the VBA?

    Click image for larger version. 

Name:	image001 (1).jpg 
Views:	8 
Size:	42.6 KB 
ID:	46603

  10. #10
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    The wizards are limited - just type cboSelectInc into the property

  11. #11
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Thank you Ajax!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 03-09-2021, 05:52 PM
  2. Form missing in Navigation Pane (not hidden)
    By Merganser in forum Forms
    Replies: 7
    Last Post: 09-11-2014, 06:55 PM
  3. Replies: 2
    Last Post: 04-21-2013, 08:03 AM
  4. Replies: 13
    Last Post: 10-19-2012, 06:34 AM
  5. Replies: 10
    Last Post: 12-31-2010, 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