Omg you guys I am going to pull my hair! I have spent so much time on one little but obviously big issue to me.
Ok, the suggested code didn't make a difference. Nothing happens when I run it! Sorry, I am sure I am forgetting something.
So to be sure I still had an option, I tried putting in the old (above) double click code on the field "Request#" (as it was working before), now that one is not working either. I restarted Access and nothing changed. I even rebooted my machine, nothing changed. What have I done wrong because still neither is working now. So, I deleted the form and recreated the form using the wizard, as I did on my first form.
The table is still "Requests". The field in the table is still the same "Request#". The new form is still called the same "TblRequest". In form design mode, I select the control "Request#" (NeoPa, thanks for teaching me the proper terminology), I jump over to view the code. With the new form when in VBA I have a new clean object with no code. I paste the below code (see below full code), save the form. Then open the form and I get an error "Run-time error '3464': Data type mismatch in criteria expression". I tried also using code with "...Me.[Request#].Value = Nz(DMax("Val([Request#])", "Requests"), 0) + 1" with no difference in the outcome.
- Private Sub Request__DblClick(Cancel As Integer)
-
-
Me.Request_ = Nz(DMax("Val([Request#])", "Requests"), 0) + 1
-
-
End Sub
Still please help!
Thank you.