Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434

    NAvigation form filter


    Hi, i use a textbox to filter my form, that's the macro:
    [NomeCognome] Like "*" & [Maschere]![Candidati]![TbxCercaCandidato] & "*"

    now, i'm putting this form in a navigation form, and the filter do not work. I read i have to change the expression, but every solution i found did not work.
    please help thx

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Reference the subform container. Access defaults to a name of NavigationSubform.

    I never use Navigation 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.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    Quote Originally Posted by June7 View Post
    Reference the subform container. Access defaults to a name of NavigationSubform.

    I never use Navigation form.
    thanks very much
    so i have to use this macro?:

    [NomeCognome] Like "*" & [Maschere]![navigation].[candidati]![TbxCercaCandidato] & "*"

    navigation is the navigation form and candidati is my form

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421

    navigation is the navigation form and candidati is my form
    One needs to know the names of the navigation form and the navigation subform control. The form name is not needed. The syntax to refer to a control on such a form is

    Code:
    [Forms]![NavigationForm]![NavigationSubform].[Form]![controlName]
    where NavigationForm is the name of the nav form and NavigationSubform is the name of the subform control. If you never altered their names, they are likely named exactly that.
    Last edited by Micron; 04-14-2020 at 04:56 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    thanks for your patience.
    i tried
    1) [NomeCognome] Like "*" & [Maschere]![navigation]![SottomascheraSpostamento].[Form]![TbxCercaCandidato] & "*"
    2) [NomeCognome] Like "*" & [Maschere]![navigation]![Candidati].[Form]![TbxCercaCandidato] & "*"

    the images show names of controls, but i had the message that "the form is not based on a table"

    Click image for larger version. 

Name:	Cattura.PNG 
Views:	30 
Size:	33.6 KB 
ID:	41558Click image for larger version. 

Name:	Cattura1.PNG 
Views:	31 
Size:	37.0 KB 
ID:	41559Click image for larger version. 

Name:	Cattura2.PNG 
Views:	31 
Size:	30.9 KB 
ID:	41560

  6. #6
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    274
    To answer it would be necessary to see how you made the project, so if you can attach the file.

  7. #7
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    If you want to upload a db, copy first, then compact, then zip. I cannot read Italian (if that's what that is) but somebody here may or at least we can probably figure it out.
    I think your 2nd and 3rd pic is of the same thing, so that's of limited use. You show us what the subform control name is BUT still not the name of the navigation form, although you have written what you think it is. The name of the tab control is of no use for this.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    i made a superlight version of my database and i deleted privacy fields, so you can manage easily.
    i can't figure out where i can find the name of the navigation form, thought.
    here you are, thanks
    https://hhfinanza-my.sharepoint.com/...AaK2A?e=f6170f

    however "SpostamentoSottomaschera" is "NavigationSubform"

    "maschera di spostamento" is "navigation form"

  9. #9
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    navigation is the navigation form and candidati is my form
    Well, not in the version you posted. It is Controllospostamento0. See the selection type and the name of that selection in the property sheet image.

    Click image for larger version. 

Name:	Navform.jpg 
Views:	26 
Size:	32.2 KB 
ID:	41564

    Now that we have that figured out, would you like to try the expression syntax I gave you earlier and see what happens?

    In the future, you will get more feedback if you upload attachments to the forum, and perhaps even more if you zip and do not rar. Some cannot upload from such places because they are at work and it is not allowed. Some will not. Others cannot handle rar files. Today was your lucky day!

    EDIT - just hand on. Let me check out something else...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    OK, this reference works provided you have clicked on a tab and loaded a form
    forms![Maschera di spostamento].sottomascheraspostamento.form
    So [Maschera di spostamento] is your navigation form name and
    sottomascheraspostamento is your navigation control name

    Controllospostamento0 is the name of the navigation control, which is not needed here.

    However, that all seems useless because you have specified [NomeCognome] in the filter BUT that is not the name of your table field. Check again. This is one reason why you should not use spaces or special characters (except maybe for underscore) in any names. Also, it seems you are using the filter in both an embedded macro and the form property sheet. I don't use macros so I'm thinking do it in one place or the other but not both. Perhaps when you fix the field name reference and do it in one place you will be OK.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    sorry for the rar, i thought it was the same

    i just deleted my [nome cognome] field that was the old one, the nomecognome is right cause is my calculated field in sharepoint.
    i had to specify the source of my navigation form, so it gave me no errors but i used this expression

    [NomeCognome] Like "*" & [Maschere]![CandidatiSP]![SottomascheraSpostamento].[Form]![TbxCercaCandidatoS] & "*" (candidatiSP is the name of navigation form that i changed and it changed in the expression by herself)

    and had no results...i deleted even the filter in property sheet but that appeared in automatic every time i run the macro...
    sigh
    EDIT -i try to make another form, cause the first is too messy,
    i'll make you know, thanks

  12. #12
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    sorry for the rar, i thought it was the same
    I could be wrong about that - I'm thinking it is not a format that windows recognizes. I use 7zip so it's no issue for me. I'm also not restricted by an employer. The language difference in your db does add some complexity to the problem. Now I'm not sure what the problem is exactly. I think you are saying that the sample form is based on a local table but in your real db it's based on a Sharepoint list?

    If we get this working in a sample db, hopefully you can apply that where and how it is necessary.

  13. #13
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    so i made another form very easy and small, on the same table based on sharepoint list (yes the test you have has only a local table but it seems the same)

    i tried the expression:
    [nomecognome] Like "*" & [Maschere]![CandidatiS2]![sottomascheraspostamento].[Form]![tbxricercacandidato]

    where [nomecognome] is the right field (calulated one), [CandidatiS2] is the navigation form and [sottomascheraspostamento].[Form] is the form in it.
    i had to select the source of the navigation form too, tried to apply filter, had no error but no filter was mas, stuck in the same record...

    i cannot figure it out

  14. #14
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    i made a test db, i have the same problem, no error but no filter
    it's superasy .,...thanks
    https://hhfinanza-my.sharepoint.com/...YkPRw?e=271fqV

  15. #15
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    I think I can only help out with the syntax that works with what you're posting. I have no idea if it will work with your real database. First, as I think I noted, I don't use macros so I removed the embedded macro and used the AfterUpdate event of the control. You click on the ellipses (...) in the property sheet to get at that. Do that and enter the code lines between Private Sub and End Sub so that it looks like this:
    Code:
    Private Sub TBXricerca_AfterUpdate()
    
    Me.Filter = "campo1 LIKE '*" & Forms![navigationform].sottomascheraspostamento.Form.TBXricerca & "*' "
    Me.FilterOn = True
    
    End Sub
    I got the form to filter using that. If you put in a value that is not in the records, it will jump to a new record. Not sure if that's ok.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-03-2022, 12:39 PM
  2. Filter buttons in navigation form
    By Charles CL in forum Forms
    Replies: 1
    Last Post: 02-05-2016, 01:04 PM
  3. Replies: 1
    Last Post: 03-05-2015, 07:50 PM
  4. Replies: 1
    Last Post: 11-05-2013, 10:09 PM
  5. Replies: 2
    Last Post: 08-18-2011, 10:20 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