Regarding form...

S

Samurai

Good day to everyone.. I am made a form and a subform in it... My form and
subform have different fields but are related by a field named "Name".. My
problem arises when I want to put a record in my subform... A pop-up window
comes out saying that "This property is read-only and can't be set." Any
comment/help is greatly appreciated.. Thanks..
 
A

Allen Browne

You've managed to confuse Access by using a field named "Name".

Almost every object in Access has a Name property, including the form. When
you try to set the Name field, Access thinks you are trying to change the
Name property of the form, and so it is complaining that the form's name is
read-only.

Make sure that the Name AutoCorrect boxes are unchecked under:
Tools | Options | General
For an explation of why, see:
http://allenbrowne.com/bug-03.html

Then open your table in design view, and change the name of the Name field
to something else: Surname, CompanyName, ... something that won't clash with
a built-in property, method, function, event, or reserved word. Save. Close.

Open your form in design view. Right-click the text box, and choose
Properties. Change its Name property (Other tab), and Control Source
property (Data tab.) Locate any code referring to the old name, and change
that as well.
 
S

Samurai

Thank you Mr. Browne for giving a reply to my problem... I did everything
what you said...Actually, what I want to do is enter a name in my main form
(so that would be seen in the field "Name" of my table), then I want my
"Name" field in my subform to return the same value at the same time in my
second table where my subform's fields come from...
 
J

John Vinson

Thank you Mr. Browne for giving a reply to my problem... I did everything
what you said...Actually, what I want to do is enter a name in my main form
(so that would be seen in the field "Name" of my table), then I want my
"Name" field in my subform to return the same value at the same time in my
second table where my subform's fields come from...

Why?

Storing data redundantly is essentially NEVER a good idea. Store the
name once; use Queries to link to it to display it in conjunction with
data in other tables.

If your subform's Table contains a foreign key linking it to the table
which contains the name, that's all you need. You can see the name
anytime, using a query joining the two tables, a Combo Box, a DLookUp,
or other techniques; storing it twice is nothing but a source of
trouble.

John W. Vinson[MVP]
 
Top