?
Solved

SSTABS and FILE LIST BOXES

Posted on 1999-07-08
11
Medium Priority
?
254 Views
Last Modified: 2010-05-02
I want to know how can I set the path to file directory boxes. I have a SSTAB (on the SSTAB a file list box), and I want whenever you change from one tab to another the contents of the file directory box change also. Could you give me the coding that I would need to use?
0
Comment
Question by:Protorian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 2

Accepted Solution

by:
Torus earned 90 total points
ID: 1522796
Put the code to the SSTAB click event

sub SSTAB1_CLICK(PreviousTab as integer)

case select sstab1.tab
case 1
      File1.Path = "YourDirectory1"
case 2
      File1.Path = "YourDirectory2"          
.
.
.
end select

end sub.
 
0
 

Author Comment

by:Protorian
ID: 1522797
I have tried the code that you gave me, I had to make a change.
I was getting an error with

case select sstab1.tab

so I read the help and changed it to

select case sstab1.tab and the error is now gone.
but I have an error at the File1.Path = "C:\Temp"
IT asks you if you want to end or debug the code.

0
 
LVL 2

Expert Comment

by:Torus
ID: 1522798
Sorry that I have a typed mistake.
Yup, it should be select case.

BTW, what the error and error code did you get? Are you sure that there is
a directory "C:\TEMP"?


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Protorian
ID: 1522799
Yes there is a directory called C:\Temp
This is the error message that I get

Run-time error '424':

Object Required
0
 
LVL 2

Expert Comment

by:Torus
ID: 1522800
Can you post what exactly your code here?
The error seems not relate to the File1.Path = "C:\TEMP"


0
 

Author Comment

by:Protorian
ID: 1522801
Private Sub SSTab1_Click(PreviousTab As Integer)
  Select Case SSTab1.Tab
    Case 1
      File1.Path = "C:\temp"
    Case 2
      File1.Path = "C:\CkBook"
  End Select

End Sub

0
 
LVL 2

Expert Comment

by:Torus
ID: 1522802
have you get the same error in the File1.Path = "C:\CkBook"
? BTW, you File List control is added at run time or design time? really no idea why you got the error. I have no problem in VB6 SP3


0
 
LVL 2

Expert Comment

by:Torus
ID: 1522803
ok, I got your error. I may misunderstand. If you want
to change the content of a file list box, File1.path.
If you want to change the dir Listbox, put dir1.path
Also make sure that the name of the control is File1 or
dir1. Otherwise, you need to put <YourControlName>.path
instead. If not, the error will occur
0
 

Author Comment

by:Protorian
ID: 1522804
This is exactly what I have


Private Sub SSTab1_Click(PreviousTab As Integer)
  Select Case SSTab1.Tab
    Case 1
      File1.Path = "C:\temp"
    Case 2
      File1.Path = "C:\CkBook"

  End Select

End Sub



I have even tried to manually set the directory

Private Sub SSTab1_Click(PreviousTab As Integer)
  Select Case SSTab1.Tab
    Case 1
      Dir1.Path = "C:\CkBook"
      File1.Path = "C:\CkBook"
   End Select

End Sub


But this does not work either.
I get the same error message
0
 
LVL 2

Expert Comment

by:Torus
ID: 1522805
Did you add the controls to your form or sstab?
The error just occurs if you haven't added the control to
the form or your controls' name doesn't match Dir1 and
File1
0
 

Author Comment

by:Protorian
ID: 1522806
I have still not gotten it to work.
But I decided to give you the points any way
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

719 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