adding new records on a continuous form

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
 
N

Nikos Yannacopoulos

Alex,

I would use a separate form in single form view, with its Data Entry
property set to Yes, opened by the command button instead.
This way you don't give users access to all the fields in all records in the
subform, and it is bound to be more stable anyway,

HTH,
Nikos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top