Hello. I am using MS Access 2003 with XP/pro. I have a form that has the following properties set through the property sheet:
form: AllowAdditions = False
CartridgeID field: Locked = True
The AllowAdditions property is set so that the user can navigate through the records but not be able to begin a new record without clicking the New Record button. The ID field is locked so the user cannot change that field, while still being able to update/edit the rest of the record.
When the user clicks on the New Record button, I want the AllowAdditions property set to True and the Locked property for the ID field set to False.
I have tried this two ways through VBA code:
According to the Access help file and the Access website, either of these should work. However, I am getting the following error message every time it hits the Me!CartridgeID. Locked = False line of code:
"Run time error 438: Object doesn't support this property or method."
I am using the exact same syntax as is displayed in the examples from the help files and I do not understand why I am getting this error.
Any assistance you can provide will be greatly appreciated.
form: AllowAdditions = False
CartridgeID field: Locked = True
The AllowAdditions property is set so that the user can navigate through the records but not be able to begin a new record without clicking the New Record button. The ID field is locked so the user cannot change that field, while still being able to update/edit the rest of the record.
When the user clicks on the New Record button, I want the AllowAdditions property set to True and the Locked property for the ID field set to False.
I have tried this two ways through VBA code:
Code:
'1: Me.AllowAdditions = True Me.DataEntry = True Me!CartridgeID.Locked = False '2: Me.AllowAdditions = True DoCmd.GoToRecord , , acNewRec Me!CartridgeID.Locked = False
"Run time error 438: Object doesn't support this property or method."
I am using the exact same syntax as is displayed in the examples from the help files and I do not understand why I am getting this error.
Any assistance you can provide will be greatly appreciated.
Comment