I have a field in a table which is not an autonumber. This is usually entered as a consecutive number by the user. I created a Query which shows the Max number from this field and displays on the form so the user knows what the last number used was.
I wanted to have a button on another form which opened this other form for data entry and would populate this field by adding 1 to the result of this query.
Is there a way to set a variable to what the result of the query is. I tried by referencing the form
Dim lt as long
lt=forms!Fdata_Last!LastNumber
.... openform
nmb = lt +1
However there was an error that it couldn't find the form referenced. It does exist so I am assuming because it is running a query this didn't work.
Any solution would be appreciated.
Thanks,