AKMonkeyboy
IS-IT--Management
Need to lookup a Max value in a table and then use that to return another value from the same table. Have the code but am getting error 3464 (data type mismatch) when I execute the code.
Both fields I'm using to lookup are Long Integers so I'm perplexed why I keep getting the error.
I've tried with the single quote around MaxID and without.
Aaarrrrgggg!!
Any thoughts?
Here's what I have so far:
Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
Both fields I'm using to lookup are Long Integers so I'm perplexed why I keep getting the error.
I've tried with the single quote around MaxID and without.
Aaarrrrgggg!!
Any thoughts?
Here's what I have so far:
Code:
Dim MaxID As Integer
MaxID = DMax("ID", "tblFileIndexEntriesIndexed")
DocID = DLookup("FileName", "tblFileIndexEntriesIndexed", "[ID]=" & "'" & MaxID & "'")
MsgBox DocID
Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.