By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,985 Members | 2,884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,985 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", ""
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
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

Unless you get another response, I would recommend you go with the open
file dialog code on the Access Web, 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.
/#) "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.