That drew a blanc...
BUT!!!
Reading that you succeeded made me attempt it on a different pc (my own). I created a new db and imported all table and form data. (I did this so I wouldn't copy any incorrect settings).
The code seemed to work, then I copied the db back to the original pc and it...
changed it to counter1...
I can't seem to figure it out....
Starting to think of a dirty solution.
Putting the tblCounter in a different db and using something like
Set ws = DBEngine.Workspaces(0)
Set dbs = ws.OpenDatabase("...\counterdb.mdb")
Set rst = dbs.OpenRecordset("SELECT * FROM...
the problem is that
DLookup("[CounterValue]", "tblCounter", "[DirectoryName] = 'GC_Annexes'") ALSO gives me the prompt
Dim fileDirectory As String
Dim temp As String
Dim counter As Integer
Yes GC_Annexes is the value of DirectoryName Field of which I need to get value which is stored in the CounterValue field
I've been starting to think it might have something to do wit the references, but I'd think that the whole DLookup function would be blocked then.
@PHV
temp =...
That one gives the error:
Run-time error '2471':
The expression you entered as a query parameter produced
this error:
'GC_Annexes'
temp = "[DirectoryName]='" & fileDirectory & "'" gives me the same box as mentioned before
Dear all,
I seem to have an issue with a piece of VBA code in acces.
Extrapolated from the larger code, I've got the snippet below.
fileDirectory = "GC_Annexes"
temp = "[DirectoryName] = '" & fileDirectory & "'"
counter = DLookup("[CounterValue]", "tblCounter", temp)
The problem now is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.