I have various forms displaying a list of records the record sourse is set to a query. I have a Add Record button to add a new record and these has been working perfectly fine on all various forms I have apart from one form that I cannot figure out why when launching the Add button it will open the form on the very first record and not a new record.
This is the code I have always been using in all forms and I change the name of the form, in this case "frm Salary", and the SetFocus for the relevant field in the form.
Any thoughts of why it is not working on this form and what I should be looking at?
Thanks
Code:
Private Sub CmdAdd_Click()
DoCmd.OpenForm "frmSalary", acNormal, "", "", acAdd
Forms!frmSalary!CmdEdit.Visible = False
Forms!frmSalary!DateValid.SetFocus
End Sub
This is the code I have always been using in all forms and I change the name of the form, in this case "frm Salary", and the SetFocus for the relevant field in the form.
Any thoughts of why it is not working on this form and what I should be looking at?
Thanks