473,667 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening windows folder

I'm trying to use a command button to open a windows folder related to the
current record. The record has a Location field that contains the name of
the windows folder, in the current directory that needs to be opened. The
code for the command button is...

Dim RetVal
RetVal = Shell("explorer CurrentProject. Path & " \ " & Me.Location",
vbNormalFocus)

When the button is pressed, I get an error - Type Mismatch

I am using the following code to view a picture of the relevent file in an
image box in the record:

Me.imgEmployee. Picture = CurrentProject. Path & "\" & Me.Location & "\" &
Me.Headshot

This code works fine. Also, if I hard code a file location into the first
line of code, it also work fine:

Dim RetVal
RetVal = Shell("explorer c:\employees\", vbNormalFocus)

This will open up the employees folder on the c: drive
Oct 3 '08 #1
2 3078
On Fri, 03 Oct 2008 01:11:27 GMT, "Kevin" <no**@email.com wrote:
>I'm trying to use a command button to open a windows folder related to the
current record. The record has a Location field that contains the name of
the windows folder, in the current directory that needs to be opened. The
code for the command button is...

Dim RetVal
RetVal = Shell("explorer CurrentProject. Path & " \ " & Me.Location",
vbNormalFocu s)

When the button is pressed, I get an error - Type Mismatch

I am using the following code to view a picture of the relevent file in an
image box in the record:

Me.imgEmployee. Picture = CurrentProject. Path & "\" & Me.Location & "\" &
Me.Headshot

This code works fine. Also, if I hard code a file location into the first
line of code, it also work fine:

Dim RetVal
RetVal = Shell("explorer c:\employees\", vbNormalFocus)

This will open up the employees folder on the c: drive
Try

RetVal = Shell("explorer " & CurrentProject. Path & " \ " & Me.Location",
vbNormalFocus)
Wayne Gillespie
Gosford NSW Australia
Oct 3 '08 #2
"Wayne Gillespie" <be*****@NObest fitSPAMsoftware PLEASE.com.auwr ote in
message news:5t******** *************** *********@4ax.c om...
On Fri, 03 Oct 2008 01:11:27 GMT, "Kevin" <no**@email.com wrote:
>>I'm trying to use a command button to open a windows folder related to the
current record. The record has a Location field that contains the name of
the windows folder, in the current directory that needs to be opened. The
code for the command button is...

Dim RetVal
RetVal = Shell("explorer CurrentProject. Path & " \ " & Me.Location",
vbNormalFocus )

When the button is pressed, I get an error - Type Mismatch

I am using the following code to view a picture of the relevent file in an
image box in the record:

Me.imgEmployee. Picture = CurrentProject. Path & "\" & Me.Location & "\"
&
Me.Headshot

This code works fine. Also, if I hard code a file location into the first
line of code, it also work fine:

Dim RetVal
RetVal = Shell("explorer c:\employees\", vbNormalFocus)

This will open up the employees folder on the c: drive

Try

RetVal = Shell("explorer " & CurrentProject. Path & " \ " &
Me.Location",
vbNormalFocus)
Wayne Gillespie
Gosford NSW Australia
That's still slightly off. Should be:

Dim q As String
q = Chr(34)
RetVal = Shell("explorer " & q & CurrentProject. Path & " \ " & Me.Location &
q, vbNormalFocus)
Oct 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2076
by: Eric Caron | last post by:
Hi Here's my problem, I create a windows service with Config.xml file. All setup for my service is in this file. I create a windows application to manage these settings (Config.XML File). This work good if the two applications are in the same folder and Config.XML is in the folder too but If not, my windows application setting don't work. In my windows form I have a Service controler components to manage my service (start, stop, ...)....
2
8044
by: sjp | last post by:
I need to open new windows only for the purpose of viewing linked images, maybe a dozen or so throughout the site. Using the Target="blank" command is quick, easy and seems like the best way to go. But if I use the javascript "open window" function, I know that I can size the new window to the exact size of the jpg image. But then I need to actually create pages for these windows and save them to my folder. With the target command, I...
2
1153
by: srik | last post by:
Dear All, I created a simple ASP.net web application on my desktop system, which has Windows XP as the Operating system. I then moved the ASP.net application to my server which has Windows Server 2003 as the Operating system. Now when I try to open the same application it gives and error
18
6709
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that I've already created on my computer. Whenever I go to open the script file (whose icon shows that it's a SQL Server Query File and I've got the file type set to open with SQLWB - SQL Server Management Studio), the file opens in Notepad instead of...
2
1591
by: Jl_G_0 | last post by:
Hey all. Got a weird problem here. I need to open a folder that is on a server. The asp.net page and the IIS are on the same server. But i Cant access it from nowhere but locally. Simply because the link directs to eg. E:\Files\Stuff ... and when any computer tries to access it, it searches on itself and not on the server. Tried to create the folder (virtual folder) inside the ASP folder on IIS (enabled Allow File Browsing too) , but...
9
1728
by: Raj | last post by:
Following is a code to open a file & print its contents on screen. But im getting the message "file can't be opened". The thing is, that if i create a file separately in a particular folder in C drive, only then my file programs are working, i.e. even after providing the full path name for the location of the file whose contents i want to read, if the file is not present in the above specified folder, im still not able to open the file....
2
430
by: pintu | last post by:
Hi Friends, I am creating one application in asp.net 2.0,c# and requirement is to open a winform while starting window and call the webservice to update some information entered in the form.Now my requirement is to use windows service to open the form..(Though i can use windows application and put the exe in start-up folder to fullfil my requirement)..And the form will take input from user. So is it possible to open any form from...
3
1602
by: =?Utf-8?B?TGllbGE=?= | last post by:
I have a user who stores her documents on a different drive and when she attempts to open documents it auto defaults to My Documents instead of her other drive. Is there a way to change the default for her?
1
1093
by: Rick | last post by:
Can you help me figure out how i can open a windows folder from code? I want a user to click a button to open a windows folder as you would when you click on a folder in "My Computer". Thanks for your help! Rick.
0
8457
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8365
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.