You can't assign a value to this object error - help please!

jhob

Registered User.
Local time
Today, 12:30
Joined
Aug 9, 2007
Messages
23
I am getting the error 'You can't assign a value to this object' when opening a form to create a new record. The form then goes blank. The form is reasonably complex with 5 sub-forms and a over 50 fields on the page.

My problem is that I can't figure out what is causing this error. How can I best trace this error? Access error reporting leaves an awful lot to be desired, I find it very frustrating like I'm fumbling around in the dark until I stumble across a solution that works. I am relatively inexperienced with access so it could be that it's my lack of access knowledge regarding bug tracking that is the problem here.

Anyhow, help would be appreciated!
 
Try taking all the subforms off the main form. if the error goes away then add each sub form one by one untill the error appears. Then you will know if it is a subform in error.
 
The same form used to work and has only had minimal changes to it since it was last working properly. It also works fine when using existing records, it's just when creating a new record that it fails. I can see it draw the form and then the error comes up and the form is blanked.

I have set breakpoints on every function that the form uses and none of them get triggered so it must be something else.

I will try the removing of subforms and see if that sheds any light.

Thanks for the assistance folks.
 
I got it sorted in the end. Turned out that it was because I had disallowed the 'Allow Additions' property so when the 'New' button was clicked access was getting itself in a bit of a tangle.

If anyone's interested I just went through the form and deleted groups of fields until the problem went away and it only went away when all of the fields had been deleted.

I then restored the project from a backup I had taken just before and switched my attentions to the triggering button and through that figured out it must be the 'Allow Additions' property that I had changed earlier today.

Thanks everyone for pointing me in the right direction, I'm sure this isn't the last you'll all hear from me!

John
 

Users who are viewing this thread

Back
Top Bottom