A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with Returned Result



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2005, 06:03 AM
Abbey Normal
external usenet poster
 
Posts: n/a
Default Help with Returned Result

I downloaded the File Picker routine from Ken Getz:
http://www.mvps.org/access/api/api0001.htm and put it into my database. this
is called when the users clicks a cmd button so they can pick a file. the
result of this pick should be put into a text box on the same form, so it
can be saved in the database. If I debug it, I see where the TestIt function
gets the right result, but how do i get that information into the TextBox?
(called PicPath) I actually have 3 access books and I'm still getting
nowhere. Any help offered would achieve hero status for at least 24hours!
Thank you.... here is the code:
Function TestIt()
Dim strFilter As String
Dim lngFlags As Long
Dim strInputFileName As String

'Modified 5/3/5 AMc
strFilter = ahtAddFilterItem(strFilter, "Jpeg Files (*.jpg)", "*.JPG")

'strFilter = ahtAddFilterItem(strFilter, "Gif Files (*.gif)", "*.GIF")
'strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
'strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

strInputFileName = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Please Choose Your File:")
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
MsgBox " " & strInputFileName & " from TestIt"
TestIt = strInputFileName
Debug.Print Hex(lngFlags)
End Function

  #2  
Old May 6th, 2005, 07:16 PM
George Nicholson
external usenet poster
 
Posts: n/a
Default


1) In the code for your command button Click event:
Private Sub cmdMyButton_Click()
Me.txtPicPath = TestIt
End Sub
Make sure this code is "attached" to the OnClick property of the button.

2) Just to be safe, change
Function TestIt()
to
Function TestIt() As String
As written, TestIt is returning a Variant variable. It never hurts to be
specific.

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Abbey Normal" wrote in message
...
I downloaded the File Picker routine from Ken Getz:
http://www.mvps.org/access/api/api0001.htm and put it into my database.
this
is called when the users clicks a cmd button so they can pick a file.
the
result of this pick should be put into a text box on the same form, so it
can be saved in the database. If I debug it, I see where the TestIt
function
gets the right result, but how do i get that information into the TextBox?
(called PicPath) I actually have 3 access books and I'm still getting
nowhere. Any help offered would achieve hero status for at least 24hours!
Thank you.... here is the code:
Function TestIt()
Dim strFilter As String
Dim lngFlags As Long
Dim strInputFileName As String

'Modified 5/3/5 AMc
strFilter = ahtAddFilterItem(strFilter, "Jpeg Files (*.jpg)", "*.JPG")

'strFilter = ahtAddFilterItem(strFilter, "Gif Files (*.gif)", "*.GIF")
'strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
'strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

strInputFileName = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Please Choose Your File:")
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
MsgBox " " & strInputFileName & " from TestIt"
TestIt = strInputFileName
Debug.Print Hex(lngFlags)
End Function



  #3  
Old May 6th, 2005, 11:00 PM
Abbey Normal
external usenet poster
 
Posts: n/a
Default

Thank you! Thank you! Thank you! Neat and Simple.

"George Nicholson" wrote:


1) In the code for your command button Click event:
Private Sub cmdMyButton_Click()
Me.txtPicPath = TestIt
End Sub
Make sure this code is "attached" to the OnClick property of the button.

2) Just to be safe, change
Function TestIt()
to
Function TestIt() As String
As written, TestIt is returning a Variant variable. It never hurts to be
specific.

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Abbey Normal" wrote in message
...
I downloaded the File Picker routine from Ken Getz:
http://www.mvps.org/access/api/api0001.htm and put it into my database.
this
is called when the users clicks a cmd button so they can pick a file.
the
result of this pick should be put into a text box on the same form, so it
can be saved in the database. If I debug it, I see where the TestIt
function
gets the right result, but how do i get that information into the TextBox?
(called PicPath) I actually have 3 access books and I'm still getting
nowhere. Any help offered would achieve hero status for at least 24hours!
Thank you.... here is the code:
Function TestIt()
Dim strFilter As String
Dim lngFlags As Long
Dim strInputFileName As String

'Modified 5/3/5 AMc
strFilter = ahtAddFilterItem(strFilter, "Jpeg Files (*.jpg)", "*.JPG")

'strFilter = ahtAddFilterItem(strFilter, "Gif Files (*.gif)", "*.GIF")
'strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
'strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

strInputFileName = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Please Choose Your File:")
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
MsgBox " " & strInputFileName & " from TestIt"
TestIt = strInputFileName
Debug.Print Hex(lngFlags)
End Function




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing Returned Positions using MATCH Sam via OfficeKB.com Worksheet Functions 10 April 16th, 2005 11:30 PM
Wrong result from INNER JOIN query if not sorting. Afzal Running & Setting Up Queries 5 April 2nd, 2005 11:39 AM
How do I turn dollar amounts into words? Theresa Wright New Users 5 January 25th, 2005 10:28 AM
Amount or Numbers in Words ron New Users 9 December 24th, 2004 07:32 PM


All times are GMT +1. The time now is 08:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.