473,785 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Click event of a tab control page not firing

I have some funky form/event behavior.

Access 97. Split frontend/backend, using Access security. I have the
same behavior (or lack of behavior) for the pag_Click() event of two
separate pages on different menu forms. Details:

frmTRNMenu is the main menu of the application. It uses tabbed pages
to logically separate menu items. The last tab on the list is
different - it has an image and then "O&M". Clicking on this last
page will IDEALLY hide the main menu and open the O&M menu. I have
directed the program, for the "On Click" event, to run my specific
"SwitchToOMRMen u" event, to achieve the ideal goal. The code works.
Or, at least, it did.

frmOMRMenu is the "O&M" menu. It has a large set of its own
options--too many to include on the main menu. It also has, as the
last page in the tab control, an "On Click" event which calls the
"SwitchToTRNMen u" subroutine. Guess what that one does...

Oh, and if someone manages to get to the page without using the mouse,
meaning without using "clicks", I have set up a command button that
says "Click Here to go to the O&M Records menu". So I have that angle
covered as well.

Now for the problem. The problem is that the click event of the page
is simply not firing. I have set a breakpoint on the beginning of the
event itself,
i.e. (*BREAKPT HERE*)Private Sub pagOMRMenuLink_ Click()

No dice. Clicking on the page does nothing.
Now. This used to work. I don't know what I did, but I apparently
broke the functionality. I will tell you what I have already done to
(unsuccessfully ) fix this:

1. I have already tried to delete the event and re-add it. Delete it
from code, save, go to the page's Properties box, click on the "On
Click" event [...] button, and generate the event again. No dice.
2. I have run /decompile, closed the db, re-opened the db, recompiled
everything, compacted, and re-entered the database. No dice.
3. I have combined #1 and #2 - deleted the event,
decompile/recompiled, then re-added the event.
I have no idea where the problem is. Just in case I'm doing something
insanely awful, I'll post my "switch" subroutines. Feel free to
critique them. Also, if there is a better suggestion as to how to
switch menus, feel free to critique my form design. I'm tough.
Pete
Attached code below, from BOTH form modules (will be long):

'frmTRNMenu code module
Option Compare Database
Option Explicit

Private m_fIsSwitching As Boolean
Private Sub cmdOMRFocusGrab ber_Click()
SwitchToOMRMenu
End Sub

Private Sub Form_Open(Cance l As Integer)
'initialize variable to false, so we know it defaults to false
m_fIsSwitching = False
End Sub


Private Sub SwitchToOMRMenu ()
On Error GoTo Sub_Error
If m_fIsSwitching = True Then Exit Sub

m_fIsSwitching = True

DoCmd.Echo False

If IsLoaded("frmOM RMenu") Then
Forms!frmOMRMen u.Visible = True
Else
DoCmd.OpenForm "frmOMRMenu "
End If

DoCmd.SelectObj ect acForm, "frmOMRMenu "

Forms!frmTRNMen u!tabMain.Pages !pag1.SetFocus
Forms!frmTRNMen u.Visible = False

m_fIsSwitching = False

DoCmd.Echo True

Sub_Exit:

Exit Sub

Sub_Error:
DoCmd.Echo True
MsgBox Err.Description
Resume Sub_Exit
End Sub
Private Sub pagOMRMenuLink_ Click()
SwitchToOMRMenu
End Sub

'----------------------------------------------------------
'----------------------------------------------------------
'frmOMRMenu code module
'----------------------------------------------------------
'----------------------------------------------------------
Option Compare Database
Option Explicit
Private m_fIsSwitching As Boolean
Private Sub Form_Open(Cance l As Integer)
'initialize variable to false, so we know it defaults to false
m_fIsSwitching = False
End Sub

Private Sub SwitchToTRNMenu ()
On Error GoTo Sub_Error
If m_fIsSwitching = True Then Exit Sub

m_fIsSwitching = True

DoCmd.Echo False

If IsLoaded("frmTR NMenu") Then
Forms!frmTRNMen u.Visible = True
Else
DoCmd.OpenForm "frmTRNMenu "
End If

DoCmd.SelectObj ect acForm, "frmTRNMenu "

Forms!frmOMRMen u!tabMain.Pages !pag1.SetFocus
Forms!frmOMRMen u.Visible = False

m_fIsSwitching = False

DoCmd.Echo True

Sub_Exit:

Exit Sub

Sub_Error:
DoCmd.Echo True
MsgBox Err.Description
Resume Sub_Exit
End Sub
Private Sub pagLast_Click()
SwitchToTRNMenu
End Sub
Nov 12 '05 #1
2 22017
"Pete" <ps********@zom bieworld.com> wrote in message
news:98******** *************** ***@posting.goo gle.com...
I have some funky form/event behavior.

Access 97. Split frontend/backend, using Access security. I have the
same behavior (or lack of behavior) for the pag_Click() event of two
separate pages on different menu forms. Details:

frmTRNMenu is the main menu of the application. It uses tabbed pages
to logically separate menu items. The last tab on the list is
different - it has an image and then "O&M". Clicking on this last
page will IDEALLY hide the main menu and open the O&M menu. I have
directed the program, for the "On Click" event, to run my specific
"SwitchToOMRMen u" event, to achieve the ideal goal. The code works.
Or, at least, it did.

frmOMRMenu is the "O&M" menu. It has a large set of its own
options--too many to include on the main menu. It also has, as the
last page in the tab control, an "On Click" event which calls the
"SwitchToTRNMen u" subroutine. Guess what that one does...

Oh, and if someone manages to get to the page without using the mouse,
meaning without using "clicks", I have set up a command button that
says "Click Here to go to the O&M Records menu". So I have that angle
covered as well.

Now for the problem. The problem is that the click event of the page
is simply not firing. I have set a breakpoint on the beginning of the
event itself,
i.e. (*BREAKPT HERE*)Private Sub pagOMRMenuLink_ Click()


Where exactly are you clicking? It may seem counter-intuitive, but the
"tab" that you click on to change Tab Pages is not considered part of the
Tab Page so it doesn't fire the page's Click event. That fires when you
click on a blank area of the page *after* you have made that page the one
"on top".

If you want an event that fires when you change Tab Pages then you have to
use the Change event of the TabControl. To make that code "page specific"
you test the value property of the TabControl in the change event to
determine which page was just selected and run your code accordingly.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2
> Where exactly are you clicking? It may seem counter-intuitive, but the
"tab" that you click on to change Tab Pages is not considered part of the
Tab Page so it doesn't fire the page's Click event. That fires when you
click on a blank area of the page *after* you have made that page the one
"on top".

If you want an event that fires when you change Tab Pages then you have to
use the Change event of the TabControl. To make that code "page specific"
you test the value property of the TabControl in the change event to
determine which page was just selected and run your code accordingly.


That's exactly what I needed to know. What happened is this:

1. I set the "click" event of the (then-empty) page. It worked as I
expected--when I clicked on the page "tab" itself, the event would
fire.
2. I added the button to the page. The event quit firing.
3. Curious as to the odd behavior, I went ahead and added a similar
button to the other page on the other menu. Now that that page was no
longer empty, that event stopped firing as well.

Now I know. Use the "On Change" event of the tab control itself.
Thanks.
Pete
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8167
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the first time the control is dynamically loaded, everything works fine. After that, if the control is loaded again from the page button event handler, the user controls events fail to fire on the first click NOTE: I (believe I) am rebuilding all...
5
11812
by: Ben Fidge | last post by:
I've got a problem where some buttons placed on a user control are only firing their OnClick events when the user clicks on them for the second time. I've got the situation where some common functionality (Insert/Edit/Save/Cancel) is wrapped up in a user control. This control is embedded on several other user controls. I don't know if this is relevant or not but the latter
2
7223
by: sanju | last post by:
hi there i am trying to fire an button event in ascx file which interacts with database ,my problem is " i am calling ascx file wiht a button click dynamically when user needs to update database in aspx page , but the the update button in ascx is not firing .. .. but it is working fine when i call ascx like this manually. '<callcontrol:callcontrol id=callcontrol runat="server"/> <%@ Register TagPrefix="callcontrol"...
4
3395
by: Ryan Ternier | last post by:
I have a button event: Public Sub SwitchItem(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim btnTest As New Button Dim astrTest As String() btnTest = CType(sender, Button) astrTest = btnTest.ClientID.Split("_") strControlsToEdit = astrTest(2)
2
9855
by: ~~~ .NET Ed ~~~ | last post by:
I have a problem (don't we all?). I have a web form with multiple modules, some of these modules have an ASP.NET (server run) button. OK, now I have UserControlX which has one such button (say Login). In that user control I defined both the Command and Click events for the button and placed a break point on it (in addition to traces). This user control is then included in the main form within the Form element/tags. Both the user control...
0
2957
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it such as when they do a delete. Everything is great. By and large it will be used in my repeater controls using the command event when the user clicks on it and so that event is working great. My issue is the Click event. When the control is...
2
3929
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite well, so at times it is tempting just to port parts of it over mostly as-is. In fact, one MSDN article I read suggested using straight HTML wherever possible to make the app more efficient and less resource demanding. On one page there are 2...
1
2867
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for that button, but everytime the button is clicked, the page posts back and the click event does not fire (probably because the button gets created every single time there's a postback). What is the best way for me to create
2
2816
by: chrisp | last post by:
I have an ASP.NET 2 page with a button that causes a credit card transaction to be authorised. The authorisation procedure may take a few seconds and so I want to prevent the user from clicking the button again (or at least detect that an authorisation is already in progress and do nothing) while the first authorisation is in progress. Can someone help me out? I've tried the following but none of the solutions work: 1) Disabling the...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.