Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

variable listbox in two forms

Posted on 2000-03-05
4
Medium Priority
?
157 Views
Last Modified: 2010-05-02
i use a object filelistbox and dirlistbox in my form.

i want to use a result of a filelistbox and dirlistbox in two different forms or in a menue.

i found out, that the variable filelistbox or dirlistbox is only available in one form and when i select the other form with the menu i can not select the filelistbox or dirlistbox of the first form.

but i will use the Contents of the two objects from the menu of the other form.

i tried to create a new filelistbox and dirlistbox with a public variable in a common module, like:

public filelistb as filelistbox

but i don't know how i can use this object.

i hope somebody can understand what i mean and can help me here
fragen
0
Comment
Question by:fragen
4 Comments
 
LVL 2

Expert Comment

by:orbitaltech
ID: 2585850
I think what you want to do is reference the filelistbox on form1. Try doing this:

Dim MyFileListBox as Form1.FileListBox

You should now be able to reference the filelistbox on form1

Hope this helps
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2586018
To reference the FileListBox on Form1 use for example:

Form1.File1.Pattern = "*.txt"
sFilename = Form1.File1.filename
0
 
LVL 4

Expert Comment

by:amit_panjwani
ID: 2586712
Instead Try this

' in Module1  Decalre Public Variable

Public MyVar as Variant

When U Get val from DirListBox Assign that value to MyVar
n Use That Value In Form2
0
 
LVL 3

Accepted Solution

by:
Gunsen earned 300 total points
ID: 2586965
By using explicit notation u can address the box of the other form from wherever u like :

Print  Form1.File1.ListCount
Print  Form2.File1.ListCount
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question