Results 1 to 9 of 9
  1. #1
    jimaccessnovice is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    10

    Loss of filter settings when changing a list form to a pop-up

    from form view in access...not pop up




    from design view....When I change the form properties to pop up


    Go back to View Form...I no longer see my filters and get the following error when I try to create on in pop up mode.

    Field 'Filters.Object Name' cannot be a zero-length string

    I am a complete novice (except for the 2 months I've been working on this project!..
    Any help is appreciated...I have no problem sharing the actual database if needed...it's just a beta version.
    This was created using the Customer Service database available on MS

    Thank you,
    Jim

    ps...tried to use screen shots but they didn't seem to work

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Save your screen shots as png or jpg files then attach the files.

    Did you close and save the form with the new setting then reopen?
    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.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I suspect it's because when the form is in design view, it's still considered to be loaded. AFAIK, a filter is applied when the form loads (or maybe opens) and when you switch views, it's not actually re-opening thus your filters are lost. A form without a filter can/will display the record(s) that were showing if switched from form to design back to form view, but I wouldn't expect a filter to be re-applied. Not sure why you'd worry about this since users will never (should never) be opening a form from design view.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    jimaccessnovice is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    10

    Second attempt to communicate better...sorry

    Click image for larger version. 

Name:	SS1.png 
Views:	11 
Size:	195.1 KB 
ID:	32590 As administrator, I have created a list of "filters" my designers can use. I created them in "form view"...as you can see below the "Pop Up" settings were set to "No".

    Click image for larger version. 

Name:	SS2.png 
Views:	11 
Size:	204.3 KB 
ID:	32591
    I then saved the form, closed and reopened in "Design View"...and changed the "Pop Up" settings to "Yes"...see below
    Click image for larger version. 

Name:	SS3.jpg 
Views:	11 
Size:	308.4 KB 
ID:	32592
    I saved and closed again...reopened in "Form View" that utilized "Pop Up" mode...now I can no longer see the filters I made.
    Click image for larger version. 

Name:	SS4.png 
Views:	11 
Size:	167.9 KB 
ID:	32593
    Furthermore, when I tried to "re-create" the filters I got the following error....

    Field 'Filters.Object Name' cannot be a zero-lenght string......which I was able to resolve by changing the "Object Name" field in the "Filter Table" to accept zero-lenght.

    Finally, this is just a modified "MS Customer Service" template....hope this is clearer now.

    My guess now is that I will just have to create the filters again for the "pop up" view form and call it a day
    Attached Thumbnails Attached Thumbnails SS5.jpg  

  5. #5
    jimaccessnovice is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    10
    Thank you June7...I just replied to Micron below with your suggested screen shots...I initially tried to just copy and paste into the message box directly...which didn't work...and I did save the form and reopened...I have included the new info in Micron's reply below...this is my first time using this forum (or any forum for that matter) so I don't know the correct protocol but wanted to recognize your efforts to assist me...thank you.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    The issue is nothing like what micron and I suspected.


    The combobox RowSource is an SQL statement with a WHERE clause of:

    WHERE ((([Object Name])=[Application].[CurrentObjectName]))

    Change it to explicitly name the form:

    WHERE ((([Object Name])="Case List"))


    Then switching between design and form views works as it should and combobox list is correct.
    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.

  7. #7
    jimaccessnovice is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    10
    Fantastic! Worked like a charm...thank you very much!

    Can I ask you another hopefully simple question about MkDir?

    I was successful in getting the following to work but the "Company.Value" returns the Customer ID number and I would like it to return the "written name"...and I know it's because the "Company.Value is based on a query so I'm lost at how to get it correct.

    Here is the Row Source: For [Company]
    SELECT [Customers Extended].[ID], [Customers Extended].[Company], [Customers Extended].[Customer Name] FROM [Customers Extended] ORDER BY [Company];


    Below is the what I used to create the command button to create a folder on our server to store case files (CAD files and large format files)

    Private Sub cmdCreateCaseFolder_Click()

    If Dir("\\MA021SFS01\NorthEast_EWP\2018CaseFolders" & Title.Value, vbDirectory) = "" Then
    MkDir ("\\MA021SFS01\NorthEast_EWP\2018CaseFolders" &
    Title.Value & "-" & Company.Value & "-" & "Case" & ID.Value)

    End If

    End Sub


    The above creates a folder like this: B19-0009-161-Case11

    I would like it to create a folder like this: B19-0009-
    ABC LUMBER-Case11

    Then I created another command button to take me to the associated case folder...see below


    Private Sub cmdGoToCaseFolder_Click()

    On Error GoTo Err_cmdExplore_Click

    Dim stAppName As String
    stAppName = "C:\Windows\explorer.exe \\MA021SFS01\NorthEast_EWP\2018CaseFolders" & Me.Title & "-" &
    Me.Company & "-Case" & Me.ID & ""
    Call Shell(stAppName, 1)

    Exit_cmdExplore_Click:
    Exit Sub

    Err_cmdExplore_Click:
    MsgBox Err.Description
    Resume Exit_cmdExplore_Click

    End Sub

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Reference columns of combobox by index. Index begins with 0 so if the company name is in column 2 its index is 1.

    MkDir ("\\MA021SFS01\NorthEast_EWP\2018CaseFolders" & Me.Title & "-" & Me.Company.Column(1) & "-" & "Case" & Me.ID)

    Value is default property so don't need to reference it. Me is alias for the form or report object the code is behind. The dot (.) will provoke intellisense popup tips and help you with correct spelling of control names and their properties.

    Is 2018CaseFolders an existing folder? Do you want to create a subfolder under that folder? Do you need a backslash after 2018CaseFolders?
    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.

  9. #9
    jimaccessnovice is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    10
    Thank you again! And I did need the backslash to create subfolders...so good catch.
    Forever grateful...

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

Similar Threads

  1. Replies: 1
    Last Post: 01-14-2016, 10:19 PM
  2. Replies: 3
    Last Post: 01-16-2015, 04:37 PM
  3. Replies: 15
    Last Post: 11-20-2013, 04:30 PM
  4. Replies: 4
    Last Post: 10-16-2013, 07:07 AM
  5. Replies: 3
    Last Post: 08-17-2012, 02:01 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