Access Sql Statement Path Information
I would like to be able to read information from an access table in order to deremine where to copy a file from and where to copy the file to. Currently eveything works except I have the Source and Target information hard coded.
Through a serious of Combo boxes and user questions my form builds a file name: strFilename = Box1 & Box2 & Box3.Pdf
When I click my browse button I want the default path to be pulled from a table with "Source" as the qualifier. Once the file is selected I want the file to be copied to the default path listed in the table with "Target" as the qualifier.
This is what I have so far but I don't know how to put the tblInfoPath.strDetails information into my variable.
Table.Fields
tblInfoPath.strPathType
tblInfoPath.strDetails
I would like to be able to read information from an access table in order to deremine where to copy a file from and where to copy the file to. Currently eveything works except I have the Source and Target information hard coded.
Through a serious of Combo boxes and user questions my form builds a file name: strFilename = Box1 & Box2 & Box3.Pdf
When I click my browse button I want the default path to be pulled from a table with "Source" as the qualifier. Once the file is selected I want the file to be copied to the default path listed in the table with "Target" as the qualifier.
This is what I have so far but I don't know how to put the tblInfoPath.strDetails information into my variable.
Table.Fields
tblInfoPath.strPathType
tblInfoPath.strDetails
Code:
Dim strSql as String
Dim rs as RecordSet
Dim strSrc as String
Dim strTrg as String
'Source
strSql = "SELECT * "
strSql = strSql & "FROM tblInfoPaths "
strSql = strSql & WHERE tblInfoPaths.strPathType " strSql = strSql & strSql & 'Source';"
DoCmd.RunSQL strSql
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot)
'What do I do
strSrc = rs