D-function Syntax with variables...

cheuschober

Muse of Fire
Local time
Yesterday, 22:57
Joined
Oct 25, 2004
Messages
168
Anyone know the proper syntax for passing string variables to d-functions as arguments? I keep trying variations on what's found below but to no avail.

Code:
Dim strTable as String
Dim strField1 as String
Dim bytResult as Byte

strTable = "Table"
strField1 = "Field1"

bytResult = DMax("'[" & strField1 & "]'", "'" & strTable & "'", "'[" & strField1 & "] <> 255'")

As it stands I get an error that it can't find my table source: "Table" (with the quotation marks in the name of the table source it's looking for).

Any thoughts?
~Chad
 
You don't need all the fancy wrapping :) try:-

bytResult = DMax(strField1, strTable, strField1 <> 255)

HTH

Peter
 
Oi. Sometimes the answer is so simple its embarassing! :o

That's what I initially thought it was but I kept getting a type mismatch error when the entire function was running. Thought it was related to this but it's another problem altogether. ;)

Thanks just the same.
~Chad
 

Users who are viewing this thread

Back
Top Bottom