"You can't assign value to this obect" error even though i can

B

BRC

I have a form that i am using to both add and edit customer info. the form
opens in the edit mode and has an "ADD" command button to add a new record.
Everything works well with one exception, when adding a new record the first
keystoke generates the this error dialog box, "You can't assign a value to
this object." (may be read only or value too large for field etc.) However,
when i say "Ok" to this dialog, whatever keystroke i typed appears field and
i can proceed with adding the info. Using Access97 and Win98. hep
 
D

Dirk Goldgar

BRC said:
I have a form that i am using to both add and edit customer info. the
form opens in the edit mode and has an "ADD" command button to add a
new record. Everything works well with one exception, when adding a
new record the first keystoke generates the this error dialog box,
"You can't assign a value to this object." (may be read only or value
too large for field etc.) However, when i say "Ok" to this dialog,
whatever keystroke i typed appears field and i can proceed with
adding the info. Using Access97 and Win98. hep

Do you have any code in the form's BeforeInsert event? Does it happen
no matter what control you first attempt to enter data in?
 
B

BRC

I failed to mention that the form that i am adding the record in is a
subform off the main form that contains the "add" buttion. When the add
button is pushed is makes the subform visiable with a new record and sets
focus to the subform. it doesn't matter which field I try to type in the
same errorr mess occurs on the first keystroke.
 
D

Dirk Goldgar

BRC said:
I failed to mention that the form that i am adding the record in is a
subform off the main form that contains the "add" buttion. When the
add button is pushed is makes the subform visiable with a new record
and sets focus to the subform. it doesn't matter which field I try
to type in the same errorr mess occurs on the first keystroke.

Could you post the complete button code? And is there any code behind
the subform? I'm hoping we can solve this without your posting all code
from both forms.
 

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