Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 01-29-2001, 01:42 PM   #1
arage
Senior Member
 
Join Date: Dec 2000
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
arage
obj required run time err why?

Hi,
Based on previous help here (hi ntp! ), Im now properly retrieving a control name for storage in a variable in a class module. Problem is that when I use the variable to access a control property I get an object required run time error 424 which says Im

References to properties and methods often require an explicit object qualifier.

Well cud someone mention a way around this? As I thought this was a valid way to store a control name that may or may not change from time to time and whose subsequent properties need to be accessed by a function.

Private Sub cmbDist_Reset()

If cmbDist = "Jonic" And cmbType = "Back end" Then
"Use the JTS system instead." _
& Chr(13) & _
"Otherwise, enter a different distributor.",
vbExclamation, "Error"
CtrlName.SetFocus
Else
Exit Sub
End If
End Sub

The problem line above occurs right before the else statement, CtrlName.Setfocus is failing although ctrlname is defined in the class as a private variant and CtrlName is first determined by the 2 functions below before going to the cmbDist_reset function I mentioned above. Wud appreciate you great peoples help.

Private Sub cmbDist_AfterUpdate()
If cmbDist = "Jonic" Then
CtrlName = cmbDist.Name
Call cmbDist_Reset
End If
End Sub

Private Sub cmbType_LostFocus()
If cmbType = "Back end" Then
CtrlName = cmbType.Name
Call cmbDist_Reset
End If
End Sub

Ive learned a lot from you folks thank you very much, but I guess I have a ways to go before Im sufficiently able to work on my own, but Im getting there for sure w/your help.
Thanks!

__________________
thanks,
Arage

arage is offline   Reply With Quote
Old 01-30-2001, 02:02 AM   #2
ElsVanMiert
Senior Member
 
Join Date: Dec 2000
Location: Nederlands
Posts: 152
Thanks: 0
Thanked 0 Times in 0 Posts
ElsVanMiert
As far as I can see this string:

"Use the JTS system instead." _
& Chr(13) & _
"Otherwise, enter a different distributor.",
vbExclamation, "Error"

is not attributed to a variable or a MSGBOX command!

Furthermore:

Else
Exit Sub

in not necessary at all.

Maybe you just modify the code and try again?
ElsVanMiert is offline   Reply With Quote
Old 01-30-2001, 04:41 PM   #3
arage
Senior Member
 
Join Date: Dec 2000
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
arage
sorry Els, i accidentally didn't include the msgbox code.

__________________
thanks,
Arage

arage is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 07:08 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World