Put string into Form field

treva26

Registered User.
Local time
Today, 11:57
Joined
Sep 19, 2007
Messages
113
A very basic question, but I am new to this...

I have the following code to get the path of an image from my form, and it works fine.
I just need to get the resulting string into the correct field on my form.
The field I want to put it in is [Photo].

Code:
Sub openfile2()

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Image Files (*.BMP)", "*.BMP")

strInputFileName = ahtCommonFileOpenSave( _
                Filter:=strFilter, OpenFile:=True, _
                DialogTitle:="Please select an image file...", _
                Flags:=ahtOFN_HIDEREADONLY)

' [Photo] = strInputFileName ???
                
End Sub

The code is called from a button on my form.
 
Hi,

Where is this code located, Form's module or a Standard module?

A very basic question, but I am new to this...
I have the following code to get the path of an image from my form, and it works fine.
I just need to get the resulting string into the correct field on my form.
The field I want to put it in is [Photo].
snip.. reduce space
The code is called from a button on my form.
 
Last edited:
Ok well I think it may be that my button is unrelated to the photo text field?
Its just a button I made and told it to call the Sub.

The MsgBox does work, it tells me the correct path.

But when I try:

Code:
[Photo] = strInputFileName

it says "External name not defined"

and when I try:

Code:
Me.Photo = strInputFileName

it says "Invalid use of Me keyword"

does that shed any light?
 

Users who are viewing this thread

Back
Top Bottom