nhorton79
Registered User.
- Local time
- Today, 18:35
- Joined
- Aug 17, 2015
- Messages
- 147
Hi All,
I've changed the way we store our quotations in our quoting database.
Where before we would store them under the project number, we are now going to sore them under the client name first and then have a subfolder for the various projects.
In order to move over all the old quotations to the new style, I'm trying to loop through all the files in the storage folder and then get the QuotationID , so that I can use fso to move them and update the QuotationLocation field in the table.
Everything seems to be going swimmingly, except it doesn't accept the filepath and filename as the criteria.
This is a snippet of my code:
This is giving me output in the immediate window of:
0
Where it should have the QuotationID as an integer.
An example of the info in QuotationLocation is:
O:\SignNET\JobRelated\31689\20170208 Palmer Equestrian.pdf
When I debug.print strCriteria on this line I get:
[QuotationLocation] = 'O:\SignNET\JobRelated\31689\20170208 Palmer Equestrian.pdf'
When I manually search the table I can find the item, but not through the Dlookup.
Am I missing a quotation mark somewhere?
Can anyone see an issue? Would love some help here.
I've changed the way we store our quotations in our quoting database.
Where before we would store them under the project number, we are now going to sore them under the client name first and then have a subfolder for the various projects.
In order to move over all the old quotations to the new style, I'm trying to loop through all the files in the storage folder and then get the QuotationID , so that I can use fso to move them and update the QuotationLocation field in the table.
Everything seems to be going swimmingly, except it doesn't accept the filepath and filename as the criteria.
This is a snippet of my code:
Code:
Dim strCriteria As String
For Each File In SubFolder.Files
strCriteria = "[QuotationLocation] = '" & File & "'"
intQuote = Nz(DLookup("[QuotationID]", "tblQuotation", strCriteria), 0)
Debug.Print intQuote
Next
This is giving me output in the immediate window of:
0
Where it should have the QuotationID as an integer.
An example of the info in QuotationLocation is:
O:\SignNET\JobRelated\31689\20170208 Palmer Equestrian.pdf
When I debug.print strCriteria on this line I get:
[QuotationLocation] = 'O:\SignNET\JobRelated\31689\20170208 Palmer Equestrian.pdf'
When I manually search the table I can find the item, but not through the Dlookup.
Am I missing a quotation mark somewhere?
Can anyone see an issue? Would love some help here.