Counter code

livvie

Registered User.
Local time
Today, 03:50
Joined
May 7, 2004
Messages
158
Can anyone tell me why this code keeps giving me the "line" value for the first rec in the recordset not for the one I have just found using rstQuote.Find

rstquote.Find "id=" & Myid

MyLineNo = DMax("line", "tblnquote_d", rstquote!line) + 1
 
livvie said:
Can anyone tell me why this code keeps giving me the "line" value for the first rec in the recordset not

You criteria is wrong.

It should be

MyLineNo = DMax("MyField", "MyQuery", "A Field = a value") + 1
 
Got it thanks
 
I'm now getting a type mismatch error on this code - where is the problem?

rstCTD.Find "drawingid=" & MyDrawid
MyCTD = DMax("CTD_number", "tbldrawings", "drawingid=" & MyDrawid) + 1
 
I'm now getting a type mismatch error on this code - where is the problem?

rstCTD.Find "drawingid=" & MyDrawid
MyCTD = DMax("CTD_number", "tbldrawings", "drawingid=" & MyDrawid) + 1

When I am doing this CTD_Number is "NCTD" and I want to change it to the next no in the sequence
 

Users who are viewing this thread

Back
Top Bottom