|
-
Mar 6th, 2001, 02:08 PM
#1
Thread Starter
Addicted Member
I want to use a variable in a module to do the following:
cboComboBox.Clear
In a module, you have to specify which form on which this is supposed to happen. I want to have the form name be a variable so that I can use this code with several forms. On the form, I have the following code:
strFormName = Me.Name
The following code, which I am putting in my module is incorrect, but how do I fix this?
strFormName!cboComboBox.Clear
Normal is boring...
 smh 
-
Mar 6th, 2001, 02:19 PM
#2
Hyperactive Member
Declare a variable to hold the form itself, not the name of the form...
Code:
Dim frmForm As YourForm
Set frmForm = Me
.....
frmForm.cboComboBox.Clear
Achichincle
VB6 (VSEE SP5, W2KPro)
ASP
HTML
-
Mar 6th, 2001, 02:26 PM
#3
Thread Starter
Addicted Member
I can not use the type "YourForm". Why?
Normal is boring...
 smh 
-
Mar 6th, 2001, 02:32 PM
#4
Addicted Member
Try Dim frmForm As Form
-Mort
-
Mar 6th, 2001, 02:43 PM
#5
Hyperactive Member
smh,
Sorry. "YourForm" was meant to be replaced by whatever you had defined your Form as... for example I have a form I use to edit patients called PatientEdit so for me it would look like...
Dim frmForm as PatientEdit
But Mortivan's suggestions should work as well.
Achichincle
VB6 (VSEE SP5, W2KPro)
ASP
HTML
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
|