473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Browse for Folder, I am still missing something

DD
Hi
Ok, i have loaded the appropriate code to call the Browse Save As
dialog box

I click a Btn from my Access form then the Dialog box appears i can
choose any file However i want to pass the file i choose to a text box
on the form
I know have included this code behind the Btn on the Form Private Sub cmdOpen_Click()

Dim strFile As String
strFile = TestIt
If Len(strFile) > 0 Then
Me!txtFile = strFile
Me![Text4] = (TestIt)

End If
End Sub

Still no show!
What am i missing???
Any assistance would be great

Nov 12 '05 #1
3 1605
What is TestIt? Is this code that is returning the selected file? If so,
make sure that the TestIt code is actually returning a file name, or post
the code beind Testit.

--
Scott McDaniel
CS Computer Software
www.thedatabaseplace.net

"DD" <da**********@bigpond.com.au> wrote in message
news:14**************************@posting.google.c om...
Hi
Ok, i have loaded the appropriate code to call the Browse Save As
dialog box

I click a Btn from my Access form then the Dialog box appears i can
choose any file However i want to pass the file i choose to a text box
on the form
I know have included this code behind the Btn on the Form

Private Sub cmdOpen_Click()

Dim strFile As String
strFile = TestIt
If Len(strFile) > 0 Then
Me!txtFile = strFile
Me![Text4] = (TestIt)

End If
End Sub

Still no show!
What am i missing???

Any assistance would be great

Nov 12 '05 #2
On 5 Jan 2004 14:15:45 -0800, da**********@bigpond.com.au (DD) wrote:
Hi
Ok, i have loaded the appropriate code to call the Browse Save As
dialog box

I click a Btn from my Access form then the Dialog box appears i can
choose any file However i want to pass the file i choose to a text box
on the form
I know have included this code behind the Btn on the Form

Private Sub cmdOpen_Click()

Dim strFile As String
strFile = TestIt
If Len(strFile) > 0 Then
Me!txtFile = strFile
Me![Text4] = (TestIt)

End If
End Sub

Still no show!
What am i missing???

Any assistance would be great


The TestIt function doesn't return anything. Try working with the
GetOpenFile() function. There is some in-line annotation that should
help.

- Jim
Nov 12 '05 #3
David,

I managed to make it work... here's the modified code...

Apologies to Ken Getz for messing with his code, but it does what you want...

'---in a separate module....

Function TestIt() As Variant '<---changed the return type to Variant
Dim strFilter As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _
"*.MDA;*.MDB")
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
'MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.

'---I bastardized this line...
TestIt = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
Debug.Print Hex(lngFlags)
End Function

button code on a form:
Option Compare Database
Option Explicit

Private Sub cmdTestIt_Click()
Dim varFile As Variant
varFile = TestIt()

If Not IsNull(varFile) Then
Me.txtFileName.SetFocus
Me.txtFileName.Text = varFile
End If

End Sub

Don't know if the function should return a string or not, but it *does* work...

HTH, and apologies for the butcher job...
Pieter
Nov 12 '05 #4

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

Similar topics

6
by: mscir | last post by:
I just installed ASP after a couple of years of not using it, PWS Win 98 SE. A couple of things are throwing me, and I can't remember whether these worked in the past. One is I can't...
5
by: deko | last post by:
I'm using the below code to allow users to browse for and select a folder. After selecting a folder from the dialog, the full path is returned to a text box and saved. The next time the user...
5
by: Eric Twietmeyer | last post by:
Hi, Does anyone know why starting with VS.NET 2002 (and same with 2003) it is no longer possible to browse to a directory that has "ept" as part of the path? It worked fine in Vc 6.x. My...
4
by: Larry Brindise | last post by:
I have an asp.net application. I have used VStudio Web Deployment Project to create the MSI file. I copy the MSI file from my developer PC to my test server running Win2003Server Web Edition. I...
5
by: Dan | last post by:
I am working on a C# ASP.NET project where I need to allow the user to browse to a folder. The only way I see how to do this is use <input type=file>. But this makes the user select a file and...
5
by: Mike Moore | last post by:
I need to create something very similiar to the browse folder capability. This would allow me to support the following - A user would create a document on their server, then they would need to...
3
by: Highlander | last post by:
Hello all. Consider the following HTA: <HTML> <HEAD> <TITLE></TITLE></HEAD> <BODY> <SCRIPT LANGUAGE="VBScript"> Sub ButBrowse_onclick() '-- show browse window and Get file path:
6
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 I am trying to browse folders through the following piece of code. Please let me know if there is any kind of setting...
1
by: =?Utf-8?B?SmF5LXBt?= | last post by:
I am trying to browse folders through the following piece of code. Please let me know if there is any kind of setting to get this working right? using shell32.dll; Shell32.ShellClass shl =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.