navigation form / filter (1 Viewer)

britesynth

Registered User.
Local time
Today, 10:06
Joined
Mar 11, 2013
Messages
88
I've been browsing for answers online and I noticed this is a common problem...


A filtered form will work just fine until placed to a navigation form, filter doesn't work

Clients Form
Savings Form

tab1 = Clients Form tab2 = Savings Form

Savings Form is filtered by ClientID from Clients Form


I tried this but didn't work inside the navigation form
*[Forms]![MAIN MENU]![NavigationSubform].[Form]![ClientID]


any workaround or suggestions?

thanks in advance!

-jake
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:06
Joined
May 7, 2009
Messages
19,230
put an unbound textbox control (say txtClient) in your navigation form (but outside the navigation subform).

on the current event of your subform in the first tab, set the value of txtClient:

private sub form_current()
me.parent!txtClient = Me.ClientID
end sub

next, on your second tab (subform), go to Property->Data.
set the Link Master Fields: [txtClient]
set the Link Child Fields: [ClientID]
 

britesynth

Registered User.
Local time
Today, 10:06
Joined
Mar 11, 2013
Messages
88
link master field and link child master field are not available in the data group

mine shows only:

filter on empty master:
enabled:
locked:


is it maybe because i'm using the form itself inside the navigation form and not a subform? 2013 version doesn't create subforms I think, am I right?

thanks!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:06
Joined
May 7, 2009
Messages
19,230
ok, if it is not available, we can use the second subform's Open event:
assuming you follow the insruction on my first post about the unbound textbox.
assuming also that you named id txtClient and that you coded the first subform's Current event to:

private sub form_current()
Me.Parent!txtClient = Me.ClientID
end sub

now on the second subform's Open event:

private sub form_open(cancel as integer)
If Trim(Me.Parent!txtClient & "") = "" Then
'Client id is not set on the navigation form
'use table name of this subform
Me.Recordsource = "tableName or QueryName here"
Else
'Client ID is present in txtClientID
Me.Recordsource = "Select * From tableName/QueryName Where " & _
"ClientID = " & Me.Parent!txtClient
End If
end sub
 

britesynth

Registered User.
Local time
Today, 10:06
Joined
Mar 11, 2013
Messages
88
hhhhhmmmm

upon copying the code my second subform disappeard

I'll try to find out where I went wrong

salamat sir Arnel
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:06
Joined
May 7, 2009
Messages
19,230
it disappeared because you already had it opened, when you opened the navigation form.
 

britesynth

Registered User.
Local time
Today, 10:06
Joined
Mar 11, 2013
Messages
88




@ sir arnelgp

here's what I tried...

but apparently whenever I switch to pclient tab my [dummy txt] says error
 

Minty

AWF VIP
Local time
Today, 03:06
Joined
Jul 26, 2013
Messages
10,371
To be honest I wouldn't use the inbuilt navigation forms - they cause all manner of issues - just as you are experiencing.
I make my own switchboard forms you are then in controls of how things are displayed and opened.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:06
Joined
May 7, 2009
Messages
19,230
this will better illustrate what you need to do.
study the code behind the subforms (master subform and slave subform).
goodluck.
 

Attachments

  • navFormAgain.accdb
    468 KB · Views: 283

Users who are viewing this thread

Top Bottom