A
Alex
I have a continuous form for data editing data for products. All fields are
locked except two for editing. But, sometimes it's necessary to add a new
product.
I'm using the following coding for that:
Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click
Me.AllowAdditions = True
DoCmd.GoToRecord acDataForm, "frmContinuousForm", acNewRec
'temporary unlocking fields to add data
'after the entries they'll be locked again.
Me.Product_ID.Locked = False
Me.Description.Locked = False
Me.ProdCateg.Locked = False
Me.Product_ID.SetFocus
Exit_cmdAddNew_Click:
Exit Sub
Err_cmdAddNew_Click:
MsgBox Err.Description
Resume Exit_cmdAddNew_Click
End Sub
However, on user's computer it looks like it's not working stable enough.
Could anybody advise whether it's a correct approach for the new
data/records adding on a continuous form.
Thanks
locked except two for editing. But, sometimes it's necessary to add a new
product.
I'm using the following coding for that:
Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click
Me.AllowAdditions = True
DoCmd.GoToRecord acDataForm, "frmContinuousForm", acNewRec
'temporary unlocking fields to add data
'after the entries they'll be locked again.
Me.Product_ID.Locked = False
Me.Description.Locked = False
Me.ProdCateg.Locked = False
Me.Product_ID.SetFocus
Exit_cmdAddNew_Click:
Exit Sub
Err_cmdAddNew_Click:
MsgBox Err.Description
Resume Exit_cmdAddNew_Click
End Sub
However, on user's computer it looks like it's not working stable enough.
Could anybody advise whether it's a correct approach for the new
data/records adding on a continuous form.
Thanks