Solved Problems with navigation form (1 Viewer)

Superpat

Member
Local time
Tomorrow, 00:12
Joined
Aug 15, 2020
Messages
96
Hello,
I have a form that works perfectly: "f Operation".
I'm trying to create a navigation form: "_f_Navigation", I can't do it.
f_navi3.png

If I remove the condition from the "r_OperationSansCumul" query, the navigation form will start, but the account choice field will no longer work.
Code:
[Forms]![f_Operation].[txt_LongCompteFK]

Critere.png

But the account choice field will no longer work.
f_navi2.png


Could you help me ?

If you have an another solution
 

Attachments

  • Essai_Navig_1.zip
    1 MB · Views: 269

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 19, 2002
Messages
43,203
The navigation form is a red herring. I don't use it because it is easy enough to create the same thing yourself by just using the Tab control and you won't run into the gotchas.

Your problem is that once you put a form on the navigation form (whether you use the Access one or roll your own), the form becomes a subform and the reference to controls on it now requires a "higher" level reference.

Forms!yourmainORnavigationform!yoursubform.Form!txtcontrolname

Notice that the parentform.Form got inserted

An additional issue with the Access navigation form is that only ONE subform is ever loaded at one time so you can only reference the VISIBLE subform.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:12
Joined
May 7, 2009
Messages
19,227
here i added [Tempvars]![tvarLongCompteFK] and use it as Criteria to your query.
see the Open event of f_Operation subform.
 

Attachments

  • Essai_Navig_1.zip
    1 MB · Views: 225

Superpat

Member
Local time
Tomorrow, 00:12
Joined
Aug 15, 2020
Messages
96
Thanks You very much to you two.
Pat Hartman, I will try later your solution.
Arnelgp, your solution is very good, just a little problem :
Code:
Compte: FindBracket([Categorie])

FindBracket.png

And I don't find any function in french about FindBracket. If was to replace :
Code:
DansChaîne(1;[Categorie];"[")
???

I resumed my old request and everything came back in order
FindBracket2.png
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:12
Joined
May 7, 2009
Messages
19,227
i did not find it in your db.
create the function on your Module:


Code:
Public Function FindBracket(Byval p As Variant) As Variant
If IsNull(p) Then Exit Function
p = Replace$(Replace$(p, "[", ""), "]", "")
FindBracket = p
End Function
 

Superpat

Member
Local time
Tomorrow, 00:12
Joined
Aug 15, 2020
Messages
96
Thanks arnelpgp, all is good.
A last thing, can you explain me :
Code:
[Tempvars]![tvarLongCompteFK]
 
Last edited:

Users who are viewing this thread

Top Bottom