Browse for File in Run-Time Is Not Working

aTmchick

New member
Local time
Today, 15:55
Joined
Jan 17, 2005
Messages
9
I have a database in which users click to browse for a file, and then import it to start off with.

I am trying to convert this database to run on the run-time version of Access, and it is getting caught up with this first action.

My Start Form has the "Browse" button on it, but when I click it, it gives me the run-time error message and shuts down my database.

Why would I get an error here and not in the full version of Access.

The browse form and code I used are based on ghudson's example in the forums.

Thanks...
 
I use that code in runtime 'all' the time without any problems. What is the runtime error number? Post your browse code.
 
Private Sub browsebene_Click()
On Error GoTo Err_browsebene_Click

Dim strFilter As String
Dim lngFlags As Long
Dim varFileName As Variant

Me.SetFocus

' strFilter = "Access (*.mdb)" & vbNullChar & "*.mdb" _
' & vbNullChar & "All Files (*.*)" & vbNullChar & "*.*"
' strFilter = "Access Files (*.mdb)" & vbNullChar & "*.mdb*"
strFilter = "All Files (*.*)" & vbNullChar & "*.*"

lngFlags = tscFNPathMustExist Or tscFNFileMustExist Or tscFNHideReadOnly

varFileName = tsGetFileFromUser( _
fOpenFile:=True, _
strFilter:=strFilter, _
rlngflags:=lngFlags, _
strDialogTitle:="Find File (Select The File And Click The Open Button)")

If IsNull(varFileName) Or varFileName = "" Then
Debug.Print "User pressed 'Cancel'."
Beep
MsgBox "File selection was canceled.", vbInformation
Exit Sub
Else
'Debug.Print varFileName
benefitfile = varFileName
End If

Exit_browsebene_Click:
Exit Sub

Err_browsebene_Click:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_browsebene_Click

End Sub
 
Also, the error does not give a code, just says execution has been stopped and the application will be shut down.
 
Do all your subs and functions have error handlers? They should and that should provide you will the runtime error number if your error handlers look like...
Code:
Exit_browsebene_Click:
Exit Sub

Err_browsebene_Click:
[COLOR=Blue][B]MsgBox Err.Number & " - " & Err.Description[/B][/COLOR]
Resume Exit_browsebene_Click

End Sub
Does the PC you are testing this runtime on have Access 2003 installed?

What version of Windows and Access are you using?

Does your runtime application work okay except for the Browse function?
 
First, thanks for trying to help me out, I really appreciate you taking an interest. The database was written on Access 2003 in Access 2000 format, because the run-time version I would like the database to run on is Access 2000. I am attemping totest the database on a computer without the full version of Access, only an Access 2000 run-time version.

All subs and functions do have error handling.

As for the rest of the database, I cannot really see whether the rest of the database is working or not because of the design. I do know that a command button that performs a multitude of queries seems to perform them and does not return an error.

I am at work right now, and can't post files to the internet, but when I get home tonight I will post the database so that you can see what I am dealing with, if you are interested.

Thanks a lot!
 
I might also note that I run Windows XP on my developing computer, but the OS on the run-time computer is Windows 2000 Professional.
 
I thought that you have to use the Access 2003 file format with the Access 2003 runtime. :confused:
 
ghudson,

Thanks for your help with the situation. It ended up being a references issue. I appreciate your help (and your code). :o
 

Users who are viewing this thread

Back
Top Bottom