"click" on tabs in navigation form

leanpilar

Registered User.
Local time
Today, 08:45
Joined
Aug 13, 2015
Messages
94
I need help to complete the code...
to "click" between tabs i use BrowseTo
Attached is a half work database...
the 02 button select the 2nd tab but get error anyway...
and if possible I need 3rd button to select the 3rd tab wich is the same subform but different filter in my main database
thanks
 

Attachments

review the code behind the click event of your buttons.
 

Attachments

I know that solution but I have 3 lvl of navcontrols and I get numlock disabled and that sendkeys not work on some filter and on load not work good.
Thanks but I need BrowseTo or other way...
 
Is it possible that is that hard and can't find a way??
 
Can you explain how I select the 3rd tab on load event?
 
Can you explain how I select the 3rd tab on load event?
You need to select the form in the 3rd tab, there is no "acBrowseToTab".
Code:
  DoCmd.BrowseTo acBrowseToForm, "[B][COLOR=Red]Frm3[/COLOR][/B]", "Navigation Form.NavigationSubform"
 
Hi,
Select the button for the 3rd load event then Property field Choose Data and NavigationTargetName (select the name of the 3rd form).
 
Ok English is my second foreign language and I can't explain myself enought...
On my main client form I have 3 level of navigationform year-month-serial of "orders" in total from 1 to 6 orders per month for more than 4000 client....
now for avoid sendkeys problem my row looks like

2016 - 2017 - 2018 - 2014 - 2015
02-03-04-05-06-07-08-09-10-11-12-01
01-02-03-04-05-06-07 (it hide unused "tab" depend of the number of orders)
evry month I need to move the current month from first place to last... and it look so wrong...
and if you open one order from another form it fail every time.

I'm starting to think to change all in tabs and make it manually visible and not visible...

with error resume next the button 1 and 2 work good but the 3 select the F2 because the F2 and the F3 has the same subform but different filter...
 

Attachments

Ok English is my second foreign language and I can't explain myself enought...
Then mostly a picture/printscreen helps.
..
with error resume next the button 1 and 2 work good ...
It doesn't work if you are in tab "F3" if you click on the button "Frm2", nothing happens.
...
but the 3 select the F2 because the F2 and the F3 has the same subform but different filter...
Why not copy the form and give it another name.
 
It doesn't work if you are in tab "F3" if you click on the button "Frm2", nothing happens.
Thanks... didn't notice that
Why not copy the form and give it another name.
that can be one solution... but...
4 years x 12 month x 7 possible orders = 336 forms and add 84 every year it's a hard work...
any other idea for filter a subform, based on selected year-month-order and to select it automatically the current month year, and than can change the filter when open from different form??
 
...
that can be one solution... but...
4 years x 12 month x 7 possible orders = 336 forms and add 84 every year it's a hard work...
That is not a solution then, it is even to clumsy, (and MS-Access has limits for controls in a form).
Could you make a picture of what you're after, maybe another solution could be found instead of using a navigation-control?
 
I managed to delete the navigation form and add a normal subform and but filter on load on and filter ID= myfunction
the function return the id of the record based of 3 criteria in 3 field on main form
and add normal command buttons like in picture and event on click to change the 3 field for the function's criteria and requery the subform...
you can see in red the current show record, in blue the existing record 2015 and 2016, 1 ,2 and 3 and the other is white.

thanks for your help
 

Attachments

  • monthlist.jpg
    monthlist.jpg
    16.9 KB · Views: 164
I managed to delete the navigation form and add a normal subform and but filter on load on and filter ID= myfunction
the function return the id of the record based of 3 criteria in 3 field on main form
and add normal command buttons like in picture and event on click to change the 3 field for the function's criteria and requery the subform...
you can see in red the current show record, in blue the existing record 2015 and 2016, 1 ,2 and 3 and the other is white.

thanks for your help
It looks okay - do you've any problem with that?
 
I had a problem with openform with filter from another form.
example:
from expired orders open the main form filtered based on selected record it work but the subform stop filtering and show only a wrong record...
I managed this was to avoid filter on form:
on click on expired form:
Code:
Dim myid As Variant 'because some are bigger than 25k and in some case it's null
myid = Me.myid.Value
DoCmd.OpenForm "mainform"
gotomysecord(myid )
and a public sub:
Code:
open recordset order by myid
do while not rst!myid = myid
n = n+1
rst.movenext
loop
docmd.gotoregord acdataform, "mainform", acGoto, n
is there a better way?
 
Why not using the where parameter in the DoCmd.OpenForm command?
Code:
DoCmd.OpenForm "mainform", , , "[YourIDFieldName]= " & Me.myid
Or do I miss something?
 
Why not using the where parameter in the DoCmd.OpenForm command?
Code:
DoCmd.OpenForm "mainform", , , "[YourIDFieldName]= " & Me.myid
Or do I miss something?

because the subform stop filtering the correct record. Even if I click on all button It not do what it has to... it show only one wrong record in the subform.
 
Do you open the form from the form you're in, (your setup sound strange)?
Do you have linked the mainform and the subform using the "Link Master Fields" and "Link Child Fields"?
Could you post the database you're working on now and describe what should be correct?
 
no, from a form expired orders if I open the form with criteria the subform linked or not it stop working, if I open without critera then add filter and filteron it works.
17Mb frontend and 10Mb backend private client data is better to not make pubblic,
I did a simple db to show the problem with the criteria
I copy the function from my db and didn's change all the names
Podaci = clients
Datume = orders
on mainform you can see the 3 different code
from the mainform the 1st code doesent work, in the form podaci it work
the second code work from both but you can't go forward and back because it's filtered
the 3rd work and you can change the client from forward and back in the podaci forlder
 

Attachments

Try it now, database attached.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom