First, clean up your keystring statement. Is Database Folder a field or variable? If it is, then
KeyString = DLookup("[FileLocation]", "tbl_FileLocations", "[Name] = '" & Me.[Database Folder] & " Attachments\IRS " & Me.IRSNumber & "'")
for a field, or
KeyString = DLookup("[FileLocation]", "tbl_FileLocations", "[Name] = '" & DatabaseFolder & " Attachments\IRS " & Me.IRSNumber & "'"
for a variable you made up. If it's part of the folder (directory) name, then it's
KeyString = DLookup("[FileLocation]", "tbl_FileLocations", "[Name] = 'Database Folder Attachments\IRS " & Me.IRSNumber & "'"
Or did you mean
KeyString = DLookup("[FileLocation]", "tbl_FileLocations", "[Name] = 'Database Folder\Attachments\IRS " & Me.IRSNumber & "'"
Second, the use of SendKeys is dangerous. If you want to use SendKeys, note that it acts upon the ACTIVE window. Is the window with the BROWSE button really the active window at that point? If not, the ALT+B will occur elsewhere where the ALT+B means nothing.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|