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
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
Comment