|
-
June 14th, 2001, 02:24 PM
#1
user control
Hi All!
I Need Help for user control.
I am tring to call a "Form" from user control
but it is giving error.
In user control I wrote this code
Sub cmdOk_click()
frmTest.Show vbModal, Me
If ModalOutput Then
strMonth = frmTest.MonthView.Month
strDate = frmTest.MonthView.Day
else
exit sub
end if
End sub
The "Form" consists of "MothView control"
Private Sub cmdOK_Click()
ModalOutput = True
Hide
End Sub
Is this Possible?
If not what is requried?
Thanks In Advance
Anita
-
June 14th, 2001, 02:44 PM
#2
Re: user control
What knd of error are you getting???
THe Hide does not seem correct. Maybe it should be ME.Hide or FormName.Hide
John G
-
June 14th, 2001, 03:14 PM
#3
Re: user control
Hi!
I am getting 2 errors.
1. Run time error '424':
Object requried
2. Runtime Error '364':
object was unloaded
Anita
-
June 14th, 2001, 05:42 PM
#4
Re: user control
I tried this also
In Module I added this code
Public fTest as frmTest
And in usercontrol
Private Sub UserControl_Initialize()
set fTest = new frmtest
load fTest
end if
If I do this I am not able to place control on "Form"
Error '91'
Object or block variable not set
Ofcourse I changed Hide as formname.hide
Anita
-
June 15th, 2001, 08:55 AM
#5
Re: user control
I may be wrong on this, but it looks like you have the frmTest outside of your user Control project. I think It must be contained within the User COntrol project.
I have a Skeleton User Control sample that is structured like this and I have no problems
+ Skeleton Project(Skeleton.vbp)
Form1(Form1)
Skeleton(Skeleton.ctl)
+ TestProject(TestProject.vbp)
Test (Test.frm)
'
'Test form calls Skeleton.ctl which does a Form1.Show with no problem.
John G
-
June 15th, 2001, 01:58 PM
#6
Re: user control
Hi John,
Thanks for replay.
I am using a thirdparty control in Usercontrol.
& I am tring to access that from "Form".(putting values into listbox-using that i am doing other process).
If i don't access that component then it works but if I use
set comp=NameofProject.component.method(or property)
It gives error '9' while placing usercontrol on test form
I am able to see methods & properties when I use
ProjectName.
Thanks,
Anita
-
June 15th, 2001, 06:32 PM
#7
Re: user control
I would get back to the author of the third party control for suggestions on how to do that. If you have no problems adding Microfost standard controls to the form, then I suggest it probably is inherent in the third party control.
'
'
Suggestion. Try doing the same thing with a Microsoft supplied control to see what happens.
John G
-
June 15th, 2001, 07:37 PM
#8
Re: user control
Thanks John!
I passed that object to that form.
It is working fine
Anita
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|