JimmyFlynn
Technical User
Hi!
This works ...
dim myresult as integer
myresult = dcount("[myfield]","mytable","[myfield]=12345"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
This doesn't!
dim myresult as integer, mysearch as integer
mysearch = 12345
myresult = dcount("[myfield]","mytable","[myfield]=mysearch"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I get all sorts of sytax errors or type mismatch errors depending on how I syntax the criteria bit of the code. I've tried every symbol on the keyboard to try and get it right but "Failed" is not in my vocabulary.
Can anybody please guide me as to the correct syntax for using a variable on this occasion ... and before you ask "myfield" is an integer only field.
Jim
This works ...
dim myresult as integer
myresult = dcount("[myfield]","mytable","[myfield]=12345"
This doesn't!
dim myresult as integer, mysearch as integer
mysearch = 12345
myresult = dcount("[myfield]","mytable","[myfield]=mysearch"
I get all sorts of sytax errors or type mismatch errors depending on how I syntax the criteria bit of the code. I've tried every symbol on the keyboard to try and get it right but "Failed" is not in my vocabulary.
Can anybody please guide me as to the correct syntax for using a variable on this occasion ... and before you ask "myfield" is an integer only field.
Jim