A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Double Click from One Tab form to the next



 
 
Thread Tools Display Modes
  #1  
Old April 6th, 2009, 10:15 PM posted to microsoft.public.access.forms
Sami
external usenet poster
 
Posts: 22
Default Double Click from One Tab form to the next

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,
  #2  
Old April 6th, 2009, 10:36 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default Double Click from One Tab form to the next

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

  #3  
Old April 6th, 2009, 10:44 PM posted to microsoft.public.access.forms
Sami
external usenet poster
 
Posts: 22
Default Double Click from One Tab form to the next

Probably should mention I'm pretty green at this VBA coding. I put the
following in the double click event for the form footer...

Me.TabCtlCaseLog.TabIndex = Me.TabCtlCaseLog.TabIndex + 1
Me.TabCtlCaseLog.Pages(TabIndex).SetFocus

And I get the error message Method or Data Member Not Found.

"Maurice" wrote:

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

  #4  
Old April 7th, 2009, 10:35 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default Double Click from One Tab form to the next

Sami,

Try the following:

In the doubleclick of the formfooter place the following code:

me.parent.tabctlCaselog.pages(tabindex + 1).setfocus

that should do the trick. The me.parent has to be placed first because the
form is actually on the tabs and we should set the reference to the tab
first. But with the line above the focus should be set to the second tab. If
you want to set it to another tab just relace the +1 with the appropriate
number.

hth
--
Maurice Ausum


"Sami" wrote:

Probably should mention I'm pretty green at this VBA coding. I put the
following in the double click event for the form footer...

Me.TabCtlCaseLog.TabIndex = Me.TabCtlCaseLog.TabIndex + 1
Me.TabCtlCaseLog.Pages(TabIndex).SetFocus

And I get the error message Method or Data Member Not Found.

"Maurice" wrote:

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

  #5  
Old April 8th, 2009, 04:26 PM posted to microsoft.public.access.forms
Sami
external usenet poster
 
Posts: 22
Default Double Click from One Tab form to the next

Maurice,

Thanks so much for trying to help me, I really appreciate it.

When I tried this code I got the following error message:

Application-defined or object-defined error

I have been working on this one problem for two weeks and as of yesterday
(before I got your response) I had nixed the idea and created the search form
as a main form that then opens the subform with tabs and got it the double
click to work that way. I backed the database up and was able to try your
suggestion with the old setup and got the above error. If you have any other
suggestions, please let me know, I will continue to move forward the
"cheaters" way (using the main form opening the subform) so that I least I
feel like I am making some progress.

Thanks again,

Sami

"Maurice" wrote:

Sami,

Try the following:

In the doubleclick of the formfooter place the following code:

me.parent.tabctlCaselog.pages(tabindex + 1).setfocus

that should do the trick. The me.parent has to be placed first because the
form is actually on the tabs and we should set the reference to the tab
first. But with the line above the focus should be set to the second tab. If
you want to set it to another tab just relace the +1 with the appropriate
number.

hth
--
Maurice Ausum


"Sami" wrote:

Probably should mention I'm pretty green at this VBA coding. I put the
following in the double click event for the form footer...

Me.TabCtlCaseLog.TabIndex = Me.TabCtlCaseLog.TabIndex + 1
Me.TabCtlCaseLog.Pages(TabIndex).SetFocus

And I get the error message Method or Data Member Not Found.

"Maurice" wrote:

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

  #6  
Old April 9th, 2009, 08:18 AM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default Double Click from One Tab form to the next

Hi Sami,

You are right in progressing with the database using another technique work
has to go on right :-)

Here's what i tried to mimic your situation, let's see if i did correctly
and can provide you with some needed assistance on this one.

I created a form an put a tabcontrol on that (two pages).
I created a subform and placed that on the first tab. On the subform i added
a formfooter and put the code on the formfooter_doubleclick event to go to
tabpage two. This worked as expected.

To make things easier for a test try the following;

Create a empty form with a tabcontrol on it (leave all the defaults)
When done you should have a form with a tabcontrol on it (probably "tabctl0"
or something like that).
Now place a button on the form and behind the click_event of the button
place the following code:

me.tabctl0.pages(0).setfocus

this will make the focus go to the first tab. Now when you want to go to the
specified second page replace the zero with a 1. This will set the focus to
the second page.

Assuming the data is always on the second page this will solve the issue
with the error you are getting.

So try this first and let me know if this works for you and we will proceed
from that point on.
--
Maurice Ausum


"Sami" wrote:

Maurice,

Thanks so much for trying to help me, I really appreciate it.

When I tried this code I got the following error message:

Application-defined or object-defined error

I have been working on this one problem for two weeks and as of yesterday
(before I got your response) I had nixed the idea and created the search form
as a main form that then opens the subform with tabs and got it the double
click to work that way. I backed the database up and was able to try your
suggestion with the old setup and got the above error. If you have any other
suggestions, please let me know, I will continue to move forward the
"cheaters" way (using the main form opening the subform) so that I least I
feel like I am making some progress.

Thanks again,

Sami

"Maurice" wrote:

Sami,

Try the following:

In the doubleclick of the formfooter place the following code:

me.parent.tabctlCaselog.pages(tabindex + 1).setfocus

that should do the trick. The me.parent has to be placed first because the
form is actually on the tabs and we should set the reference to the tab
first. But with the line above the focus should be set to the second tab. If
you want to set it to another tab just relace the +1 with the appropriate
number.

hth
--
Maurice Ausum


"Sami" wrote:

Probably should mention I'm pretty green at this VBA coding. I put the
following in the double click event for the form footer...

Me.TabCtlCaseLog.TabIndex = Me.TabCtlCaseLog.TabIndex + 1
Me.TabCtlCaseLog.Pages(TabIndex).SetFocus

And I get the error message Method or Data Member Not Found.

"Maurice" wrote:

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

  #7  
Old April 9th, 2009, 10:29 PM posted to microsoft.public.access.forms
Sami
external usenet poster
 
Posts: 22
Default Double Click from One Tab form to the next

Hi Maurice,

I am going to try this tomorrow (if things go better) had connectivity
issues all day and haven't had an opportunity to try this.

I will let you know, and again, THANK YOU!

Sami

"Maurice" wrote:

Hi Sami,

You are right in progressing with the database using another technique work
has to go on right :-)

Here's what i tried to mimic your situation, let's see if i did correctly
and can provide you with some needed assistance on this one.

I created a form an put a tabcontrol on that (two pages).
I created a subform and placed that on the first tab. On the subform i added
a formfooter and put the code on the formfooter_doubleclick event to go to
tabpage two. This worked as expected.

To make things easier for a test try the following;

Create a empty form with a tabcontrol on it (leave all the defaults)
When done you should have a form with a tabcontrol on it (probably "tabctl0"
or something like that).
Now place a button on the form and behind the click_event of the button
place the following code:

me.tabctl0.pages(0).setfocus

this will make the focus go to the first tab. Now when you want to go to the
specified second page replace the zero with a 1. This will set the focus to
the second page.

Assuming the data is always on the second page this will solve the issue
with the error you are getting.

So try this first and let me know if this works for you and we will proceed
from that point on.
--
Maurice Ausum


"Sami" wrote:

Maurice,

Thanks so much for trying to help me, I really appreciate it.

When I tried this code I got the following error message:

Application-defined or object-defined error

I have been working on this one problem for two weeks and as of yesterday
(before I got your response) I had nixed the idea and created the search form
as a main form that then opens the subform with tabs and got it the double
click to work that way. I backed the database up and was able to try your
suggestion with the old setup and got the above error. If you have any other
suggestions, please let me know, I will continue to move forward the
"cheaters" way (using the main form opening the subform) so that I least I
feel like I am making some progress.

Thanks again,

Sami

"Maurice" wrote:

Sami,

Try the following:

In the doubleclick of the formfooter place the following code:

me.parent.tabctlCaselog.pages(tabindex + 1).setfocus

that should do the trick. The me.parent has to be placed first because the
form is actually on the tabs and we should set the reference to the tab
first. But with the line above the focus should be set to the second tab. If
you want to set it to another tab just relace the +1 with the appropriate
number.

hth
--
Maurice Ausum


"Sami" wrote:

Probably should mention I'm pretty green at this VBA coding. I put the
following in the double click event for the form footer...

Me.TabCtlCaseLog.TabIndex = Me.TabCtlCaseLog.TabIndex + 1
Me.TabCtlCaseLog.Pages(TabIndex).SetFocus

And I get the error message Method or Data Member Not Found.

"Maurice" wrote:

You could use the tabindex value for that.

when doubleclicking you can set the tabindex as follows:

me.tabctl.tabindex=me.tabctl.tabindex+1
me.tabctl.pages(tabindex).setfocus

which will make it go to the next tab

with that in mind you could add a couple more lines to place a filter on the
form which is on the second subform.

forms!frmsubformname.filter="your id field here"
forms!frmsubformname.filteron=true

maybe two pointers to get you started.

--
Maurice Ausum


"Sami" wrote:

I have a main form with four tabs. The fist tab contains a form that allows
the user to enter search criteria and upon clicking the Search button the
form footer shows the results of the search. I would like the user to be
able to double click on the case number (primary key for table) from the form
footer for their choice and have it automatically go to the next tab
(MasterInfoSubform) which contains the information for the record from the
same table. I have searched the discussion group and tried several things,
but can't seem to get right. ANY help would be GREATLY appreciated.

Thanks,

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.