Hi everyone
I recently converted my DB backend from MySQL to access (was having stability issues).
In MySQL, i had set my primary key to start at 2000 and auto-increment from there. Converting it back, obviously i now can't use auto-number.
The primary key is used as a reference for the call (its a call management DB). I know i'm not supposed to expose the user to a PK or use it for anything but internal referencing, but unfortunately i didn't stick to that.
Now obviously before, when i entered a new workorder, it would automatically go to the next number, now i need this to happen with the new access backend.
I have entered this as the control source on the form for workorderID:
Code:
=Nz(DMax([WorkorderID],[Workorders]),0)+1
Im getting a circular reference error when in design view and the always helpful #Name when in form view.
Any help would be appreciated .
Thanks a lot.
Edit: I just realised, i view workorders as well as create them, using the same form. Heres the code i use to determine if we are viewing or creating:
Code:
If Forms![Workorders by Customer]![Workorders by Customer Subform].Form.RecordsetClone.RecordCount > 0 Then
DoCmd.GoToControl "WorkorderID"
DoCmd.FindRecord Forms![Workorders by Customer]![Workorders by Customer Subform].Form![WorkorderID]
End If
Should i be adding the Nz(Dmax) functions into that code, rather than the control on the form?