Subform field entry creates a new record

Gkirkup

Registered User.
Local time
Yesterday, 22:52
Joined
Mar 6, 2007
Messages
628
I have a main form with several tabs. One of the tabs is a subform with just one number control, driven by a select query. The control shows a number, and you can type in a new number, which then updates the field in the table.
BUT, the control then shows a zero, it has moved to a blank record. If you enter a number again, it will attempt to write it to a new record.
So how do I display the number, and allow a new number to be entered that will update the SAME record, and not moved to a new record?

Robert
 
Try in form properties, data sheet, allow addition = no

Or

Private Sub form_beforeinsert(cancel as intiger)
Cancel = True
MsgBox "You cannot add new data to the form.", vbInformation, "Permission denied."
'You can also add here select focus back to this field.
End Sub

It's from top of my head so unsure of either ;)
 

Users who are viewing this thread

Back
Top Bottom