I have a form opening in read-only mode via:
DoCmd.OpenForm "frmAddVisit", acNormal, , , acFormReadOnly, acWindowNormal, "[ID] = " & Me.txtMemberID
But the on the form that displays the record in read-only mode I have a command button that when clicked I want to have the form display for a new record to be entered. Here is my onclick code but it doesn't make the form read for a new record to be entered.
Private Sub cmdAddRecord_Click()
On Error GoTo cmdAddRecord_Click_Err
On Error Resume Next
Me.AllowEdits = True
DoCmd.GoToRecord , "", acNewRec
If (MacroError <> 0) Then
MsgBox MacroError.Description, vbOKOnly, ""
How can I re-write this code to make the form ready for a new record?