Error 3075_code syntax (1 Viewer)

SharonC

Registered User.
Local time
Today, 07:59
Joined
Oct 19, 2001
Messages
21
Hello all

Just a quick question:

Why does this work perfectly:
RunTimePoints.Value = DLookup("PTPoints", "Point Table", "PTRun = [RunTime]")

yet, this doesn't:
rst.Fields("RunTimePoints").Value = DLookup("PTPoints", "Point Table", "PTRun = " & rst.Fields("RunTime").Value)

I'm getting a runtime error #3075 on this line. I have a funny feeling it's having to do with single/double quotes.

[RunTime] is a text field.

Any thoughts would be appreciated.
 

Mile-O

Back once again...
Local time
Today, 12:59
Joined
Dec 10, 2002
Messages
11,316
SharonC said:
I'm getting a runtime error #3075 on this line. I have a funny feeling it's having to do with single/double quotes.

Then do this:

rst.Fields("RunTimePoints").Value = DLookup("PTPoints", "Point Table", "PTRun = """ & rst.Fields("RunTime").Value & """")
 

Fornatian

Dim Person
Local time
Today, 12:59
Joined
Sep 1, 2000
Messages
1,396
Just veering off on a tangent for a second, but I assume you are updating a field value this way? If so, you don't need to because that value can be retrieved using a query if PTRun is unique in the Point Table, if isn't unique then then DLOOKUP would be unreliable.
 

SharonC

Registered User.
Local time
Today, 07:59
Joined
Oct 19, 2001
Messages
21
Thank you, Mile! Worked like a charm!

And thanks, Forn. You're quite correct in your observations. I'm just working with a really hosed up program right now and I just want to see things "work" (if you know what I mean).

Thanks to both of you!

Peace
 

Users who are viewing this thread

Top Bottom