Can't assign a value ...

S

Sue Compelling

Hi All

I have a subform that has 2 fields on it. Region and Address.

On the first instance only when I use the "Region" field the following error
pops up - yet

* none of these conditions are met and
* if I press ok on the pop up it lets me enter a value regardless

Error message is ...

You can't assign a value to this object

* The object may be a control on a read-only form
* The object may be on a form that is open in design view
* The value may be too large for this field

Any ideas?

TIA

Sue
 
G

Graham Mandeno

Hi Sue

Most Access error messages should have attached a caveat that says "The
suggested causes above are more than likely spurious". :)

Some clarifying questions:

1. When you say "use" the Region field, do you mean begin to type something
in the textbox, or exit the textbox having typed something, or perhaps
something else?

2. Does the Region textbox have any event properties assigned? If so, which
one(s) and what event code is being executed?

3. Does the form have any event properties assigned, in particular, OnDirty,
BeforeInsert, OnCurrent?

4. Does this happen when there are already records in the subform, or only
when the subform is empty and you are entering the first record?
 
S

Sue Compelling

Hi Graham

Nice to "see" you again ...

In response to your questions ...


1. When you say "use" the Region field, do you mean begin to type something
in the textbox, or exit the textbox having typed something, or perhaps
something else? (Sorry - yes, I meant ... go to type something in that field)

2. Does the Region textbox have any event properties assigned? If so, which
one(s) and what event code is being executed? (No event properties)

3. Does the form have any event properties assigned, in particular, OnDirty,
BeforeInsert, OnCurrent? (No event properties - especially not that dirty one)

4. Does this happen when there are already records in the subform, or only
when the subform is empty and you are entering the first record? (Only when
I'm entering the first record)



--
Sue Compelling


Graham Mandeno said:
Hi Sue

Most Access error messages should have attached a caveat that says "The
suggested causes above are more than likely spurious". :)

Some clarifying questions:

1. When you say "use" the Region field, do you mean begin to type something
in the textbox, or exit the textbox having typed something, or perhaps
something else?

2. Does the Region textbox have any event properties assigned? If so, which
one(s) and what event code is being executed?

3. Does the form have any event properties assigned, in particular, OnDirty,
BeforeInsert, OnCurrent?

4. Does this happen when there are already records in the subform, or only
when the subform is empty and you are entering the first record?

--
Cheers! :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Sue Compelling said:
Hi All

I have a subform that has 2 fields on it. Region and Address.

On the first instance only when I use the "Region" field the following
error
pops up - yet

* none of these conditions are met and
* if I press ok on the pop up it lets me enter a value regardless

Error message is ...

You can't assign a value to this object

* The object may be a control on a read-only form
* The object may be on a form that is open in design view
* The value may be too large for this field

Any ideas?

TIA

Sue
 
S

Sue Compelling

Hi Ling

The Answer to the Allow Edits and Allow Additions is ... they are both set
to yes

The answer to your "is your filed the link to the main form"? The answer is
no

There are 3 fields on my subform:
Region
Description
RegionID

The RegionID is an invisible field and is the "Link Child Field" to my
RegionFK "Link Master Field"

HTH

Cheers
 
G

Graham Mandeno

Hi Sue

It seems that you have the many side of your relationship on the main form,
and the one side on the subform. Is this right? (The clue was your
excellent naming convention - RegionID and RegionFK :)

This setup is unusual, but is useful in certain situations. For example,
you could have a subform showing customer details as you scroll through a
main form of orders. However, you will never be able to add records to the
subform, because (assuming RegionID is a primary key, and you have
relational integrity) the master field cannot exist until the child field
exists, and you cannot have more than one child field.

I suggest you take a step back and ask yourself what you are really trying
to do here.
 
S

Sue Compelling

Hi Graham

Good call on going right back to what I was trying to achieve. I linked the
fields (with exquisite naming conventions) together so that my subform would
appear "blank" and I could enter a new record (ie - I didn't want the 167
existing region records to present as this was for entering NEW data only.

I should have course just changed the form to data entry mode (to achieve
the same effect) - but needed yours and King's prompt to realise what I
should have done.

Thanks a mill

Cheers

--
Sue Compelling


Graham Mandeno said:
Hi Sue

It seems that you have the many side of your relationship on the main form,
and the one side on the subform. Is this right? (The clue was your
excellent naming convention - RegionID and RegionFK :)

This setup is unusual, but is useful in certain situations. For example,
you could have a subform showing customer details as you scroll through a
main form of orders. However, you will never be able to add records to the
subform, because (assuming RegionID is a primary key, and you have
relational integrity) the master field cannot exist until the child field
exists, and you cannot have more than one child field.

I suggest you take a step back and ask yourself what you are really trying
to do here.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand
 

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