Load 'Directory' into TextBox

R

ryguy7272

I’m using the code from here:
http://www.mvps.org/access/api/api0002.htm

Works great! Now, I named a TextBox ‘Att’ (for an attachment) and tried to
get Directory name into my Att (TextBox).

I am trying to run this code:
Private Sub Command17_Click()
Dim strFolderName As String
strFolderName = BrowseFolder("What Folder you want to select?")
.FormFields("Att").Result = Forms!frmMail.strFolderName
End Sub

Something isn’t working right. I get an error here:
..FormFields("Att").Result = Forms!frmMail.strFolderName

Error Message is: Compile Error – Invalid or unqualified reference


I changed that one line of code to this:
..TextBox("Att").Result = Forms!frmMail.strFolderName

Still receive the same message.

What am I doing wrong?


Thanks,
Ryan---
 
K

Ken Snell \(MVP\)

Change this code line:
.FormFields("Att").Result = Forms!frmMail.strFolderName

to this:
Me.Att.Value = strFolderName
 
R

ryguy7272

Brilliant!!! My interest in Access appreciates every single day!!
Thanks so much Ken!
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top