Using Access 2000, Windows 2000
I have created a form with 5 buttons on it to open forms. Four currently work. When I added the 5th button today to open the form (just like all the rest) it goes straight into the ON_ENTER code on the form.
When it gets to this point in main code that calls the form.....
DoCmd.OpenForm stDocName, , , stLinkCriteria
....it immediately enters the following sub and it causes an error because it's recognizing the Main calling form as active and not the actual form that is called. The Main calling form ActiveControl is a button and it throws and error when it reaches the ctrlTemp.text because "OBJECT DOES NOT SUPPORT THIS PROPERTY OR METHOD". There are numerous controls on the called form and the idea is when the user enters the control it kicks off this code; therefore, gathering all of the control data and passing it to another function. This is only a sample of one of the controls on my form. The weird thing is that if there is only 1 ON_ENTER sub, it works just fine, but more than one throws the error.
Private Sub NET_MWH_Enter()
Dim ctrlTemp As Control
Dim frm As Form
''FOR SOME REASON, IT'S NOT SEEING THE REPORT(FORM) AS THE ACTIVE FORM, BUT THE ADMINISTRATOR FORM
Set ctrlTemp = Screen.ActiveControl
Set frm = Screen.ActiveForm
Call Enter(Me.NET_MWH_TLQ.value, ctrlTemp.Text, ctrlTemp.Properties(1), "LAKDBA_JLK_LOAD", frm)
End Sub
--The ctrlTemp.Text is the value in the control.
--The ctrlTemp.Properties(1) is the first property for that control which happens to be the name of the control.
--"LAKDBA_JLK_LOAD" is my table.
--frm is the active form
I've tried hard-coding in the ctrlTemp.Text and ctrlTemp.Properties(1), but it threw and error for the frm argument.
NOTE: This is currently working of 4 other forms. There is no reason for it not to work; however, we all know "MURPHY".
If someone knows why this is happening, any help would be greatly appreciated. Thanks in advance.
jodo
LUCK - WHERE PREPARATION MEETS OPPORTUNITY!!
I have created a form with 5 buttons on it to open forms. Four currently work. When I added the 5th button today to open the form (just like all the rest) it goes straight into the ON_ENTER code on the form.
When it gets to this point in main code that calls the form.....
DoCmd.OpenForm stDocName, , , stLinkCriteria
....it immediately enters the following sub and it causes an error because it's recognizing the Main calling form as active and not the actual form that is called. The Main calling form ActiveControl is a button and it throws and error when it reaches the ctrlTemp.text because "OBJECT DOES NOT SUPPORT THIS PROPERTY OR METHOD". There are numerous controls on the called form and the idea is when the user enters the control it kicks off this code; therefore, gathering all of the control data and passing it to another function. This is only a sample of one of the controls on my form. The weird thing is that if there is only 1 ON_ENTER sub, it works just fine, but more than one throws the error.
Private Sub NET_MWH_Enter()
Dim ctrlTemp As Control
Dim frm As Form
''FOR SOME REASON, IT'S NOT SEEING THE REPORT(FORM) AS THE ACTIVE FORM, BUT THE ADMINISTRATOR FORM
Set ctrlTemp = Screen.ActiveControl
Set frm = Screen.ActiveForm
Call Enter(Me.NET_MWH_TLQ.value, ctrlTemp.Text, ctrlTemp.Properties(1), "LAKDBA_JLK_LOAD", frm)
End Sub
--The ctrlTemp.Text is the value in the control.
--The ctrlTemp.Properties(1) is the first property for that control which happens to be the name of the control.
--"LAKDBA_JLK_LOAD" is my table.
--frm is the active form
I've tried hard-coding in the ctrlTemp.Text and ctrlTemp.Properties(1), but it threw and error for the frm argument.
NOTE: This is currently working of 4 other forms. There is no reason for it not to work; however, we all know "MURPHY".
If someone knows why this is happening, any help would be greatly appreciated. Thanks in advance.
jodo
![[sunshine] [sunshine] [sunshine]](/data/assets/smilies/sunshine.gif)
LUCK - WHERE PREPARATION MEETS OPPORTUNITY!!