By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

dialog box error

P: n/a
Look at the following code:

Private Sub cmdEnter_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogOpen)
Dim vrtSelectedItem As Variant

With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
MsgBox "The path is: " & vrtSelectedItem
DoCmd.TransferDatabase acLink, "dBase III", vrtSelectedItem,
acTable, "ZIP", "holdingtable.zip"
Next
End If
End With
End Sub

When I selecte a file from the dialog box, the message box shows the
complete path. When I click OK on the message box, I get a Visual
Basic error that says it is not a valid path. When I debug in VB and
hold my cursor over the variable "vrtSelectedItem" it shows the same
path that was in the message box. Why does it think the path is
invalid?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Brenda wrote:
path that was in the message box. Why does it think the path is
invalid?


Unless you get another response, I would recommend you go with the open
file dialog code on the Access Web,
http://www.mvps.org/access/api/api0001.htm. You can modify it as you
see fit - if you're not familiar with some of the API stuff, just go
through the code carefully and use the test proc and you'll see where
you can set up default file types, etc, etc.

I started using this in A97 and it works fine in A2003.

From reading here on the newsgroup, the method you're using appears to
have some bugs, or so it would seem from the posts I've read about it.
--
Tim
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.