[RESOLVED] Dtpicker problem, Please help Thanks
Hi all,
Happy Chinese New Year, can anyone help me to solve the problem ?
Why the error appear when I compile the code as below.
vb Code:
If Typeof Ctrl is DTPicker then
...
End If
Error Message : Compile Error :
A module is not a valid type
Why this error appear and how to solve it ?
Thanks for help :-)
Re: Dtpicker problem, Please help Thanks
Are you using like this... And where are you using the code in form or module
Code:
For Each ctl In Me.Controls
If TypeOf ctl Is DTPicker Then
Print "DTP"
End If
Next
Re: Dtpicker problem, Please help Thanks
vb Code:
dim ctrl as control
dim ctl as control
For Each Ctrl in Me.Controls
If TypeOf Ctrl Is Frame Then
For Each Ctl in ctrl.Parent
If TypeOf Ctl is DTPicker Then 'ERROR OCCURED HERE
......
End If
Next
End If
Next
Re: Dtpicker problem, Please help Thanks
Dim ctl As Control
Code:
For Each ctl In Me.Controls
If ctl.Container.Name = "Frame1" Then
If TypeOf ctl Is DTPicker Then
Print "DTP1"
End If
End If
Next
Re: Dtpicker problem, Please help Thanks
I had tried your method,
The Error Still Occured.
Re: Dtpicker problem, Please help Thanks
Re: Dtpicker problem, Please help Thanks
I been rated you, Thanks you help.
However for the 1st link you provided to me, I think that was not my main problem cause i didnt using ms access..
For the second problem, I not really understand furthermore the last post also didn't have any resolution .
Thanks ...
Re: Dtpicker problem, Please help Thanks
Quote:
I been rated you, Thanks you help
. If I could not help you why rate me :confused:
Pls start a new proj add a frame (Frame1) and place one DTP in it, and run the snippet at #4 (you may add other controls) and post back
Re: Dtpicker problem, Please help Thanks
sounds like you must have a module with the name DTPicker as well
i tested that it will definitley give that error
try this instead
vb Code:
If TypeName(ctl) = "DTPicker" Then 'do stuff
Re: Dtpicker problem, Please help Thanks
GODLIKE !!
You had solved my problem.
I found that i got another modules name same as my control classname.
Thanks a lot ...
Re: [RESOLVED] Dtpicker problem, Please help Thanks
I had a doubt something else is interfereing thats why I recommended you to start a new proj and test