Brain needs a nudge ... Check for varaiable in a table

daievans

Registered User.
Local time
Yesterday, 20:41
Joined
Apr 3, 2013
Messages
75
Friday afternoon and I'm not thinking very well ...

I have a process that reads a list of files sequentially and then processes them .... As each file is processed, its name (strfile) gets written to a Table (Vault.[Processed_file])

I want to verify if the file exists in the table prior to processing it - if it exists, I won't process it again ...

I'm having a complete fade on how to do this ...

Anyone got an insight ?

:banghead:
 
You could use a DCount():

If DCount(...) = 0 Then
'import the file
End If
 
Code:
If (DCount("Processed_File", "Vault", strFile) > 0) Then
dbs.Execute strSQLVaultDup
Kill strPathFile
strFile = Dir(strPath & "*" & strFileExt)
 
End If

So this was working in a prior incarnation on Friday but today I seem to have screwed it up (again) ...

strFile is the variable that I'm checking to see if it exists in the table, however it produces an error 3075 Missing Operator .....

PBaldy - if you're awake in Nevada, I'd appreciate your eagle eye on this thing .... Of course all others are also welcome :D
 
What exactly does strFile contain? It couldn't just be a file name, it would have to include the field, like:

FileName = 'filename.txt'
 
The Field in the Table is [Processed_File] - The table Name is "Vault" ...

so my criteria should be [Processed_File]= strFile ?

I looked at the syntax earlier {expression.DCount(Expr, Domain, Criteria)} and thought that expr was enough - obviously not!
 

Users who are viewing this thread

Back
Top Bottom