Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd Error Message 2

Status
Not open for further replies.

jacque427

Technical User
Nov 5, 2003
122
US
Because of help offered here I've fixed a previous problem.
(many thanks!)

But a new one has arose/arisin/come-up within the database.

When adding a record I get an error message saying the record is set read-only. But I have looked at every property setting and can't see where that is set.

The link to see is it at






Knowlegeable enough just to cause serious problems.
 
We need more information. Is this in a form or table or recordset or query or what? Is the file read-only? Can you edit other records in the MDB?

Duane
MS Access MVP
 
Sorry about that, I'm a pretty basic user/programmer.

It is in a sub-form that is pulling data from a table.

I've looked at all the properties. Both in the main form, sub-form and the tables but can't find anywhere that has a spot as read-only or locked.

And I can edit ok, just the annoying message pops up. "Ok" it (the error message), and the form accepts and holds the data just fine.



Knowlegeable enough just to cause serious problems.
 
Is it really an error message or a warning message that says something like 'you are about to update 1 record' ?

Transcend
[gorgeous]
 
It's a real error message or warning "This property is read-only and can't be set".

It happens when ever I update any of the fields in the sub-form. But again, I believe I've looked at all the fields but can't see what property is set as such.



Knowlegeable enough just to cause serious problems.
 
Your first message suggested the error was "the record is set read-only". Now you stated "This property is read-only and can't be set". If you can't provide actual error messages then we will spin our wheels.

Do you have any code or macros running?

Duane
MS Access MVP
 
Sorry about that, my fault. The correct message is "This property is read-only and can't be set".

It is received any time I try to enter new data into either of the 1st 3 columns. Once data is entered into that record it doesn't repeat.

Start a new record in the sub-form and the message re-appears.

There is only one macro running to maximize the the form.

As for code that is beyond me. I can look at it but don't know how to write it..







Knowlegeable enough just to cause serious problems.
 
what are the names of the three fields that you get the error message on?
 
toc (text)
time: (text)
description: (memo)
name (number) -hidden on the form-
id (autonumber) - hidden on the form-

Would you like me to e-mail you the database? It's about 600k in size.



Knowlegeable enough just to cause serious problems.
 
Time is a reserved word, perhaps if you change the field name Access won't think you are trying to edit the TIME property.
 
I changed it to "test", same message pops up.





Knowlegeable enough just to cause serious problems.
 
Hi again jacque427!

Had 'nother browse thru your database. I still do recommend you try some of the advice given in thread702-700440 and thread702-699592.

Roy-Vidar
 
Hi Roy, I'm a pretty basic user and this is my first time doing a database of this magnitude.

Those threads confused me.

Can they be clarified?







Knowlegeable enough just to cause serious problems.
 
Sure!

I'm very sorry for confusing you, let's make it right!

If you choose to use those threads, the db will soon be working!

We'll just take the questions one by one. Start with forgetting about the forms for a while;-) (It might be an idea to recreate them after the db is working)

Then delete the relationships between the dar and sub_dar tables.

Then in the sub_dar table, select the id field and
1 remove the primary key (click the primary key button on the toolbar)
2 see to it that the index property of the field is set to "Yes (dublicates OK)"

Roy-Vidar
 
Ok, done (all of the above including removing the forms).

Knowlegeable enough just to cause serious problems.
 
Oups - didn't say remove them, just forget about them for a while, but it might be for the good.

Very sorry for the long delay. My ISP found this time a good time for having problems;-)

Sure ther's no primary key in sub_dar? (just checking;-)

Oh - and forgot - (IMPORTANT) the datatype of ID in sub_dar must be changed from AutoNumber to Number, with field size Long Integer

Now, as lespaul also states, you should rename some of the fields in both tables. Some suggestions:

Date->EntryDate, SubmitDate, fldDate... (as long as it isn't just Date)
Time->OccuredTime, fldTime, actTime... (as long as it isn't just Time)
I'm very conservative, so I also suggest changing Name to something else too - OffName, fldName, WriterName (though this should't be a real problem)

The next step, would be to create a primary key for the sub_dar table. I think that the combination of id and the datefield might be alright, but let's take that after you've successfully renamed the fields and changed the sub_dar.id from autonumber.

I'll continue to keep an eye on this thread...

Roy-Vidar
 
I'm back, I had to go to my "real" job.

Did just as you stated.

I am ready to set a primary key or whatever you suggest.






Knowlegeable enough just to cause serious problems.
 
OK - then we build a composite primary key for sub_dar table.

Enter design view of the table. Don't know if you've desided to use your datefield together with the id, but in any case. Based on what I can see, the datefield should be OK.

First select the id field (click the grey box to the left of the name)
Press and hold CTRL
Select the next field (click the grey box to the left of the name) (and release CTRL)

Click the primary key button on the toolbar. This should produce a composite primary key (both the ID field and the other field will have a key symbol on them)

That OK?

Now we can do the relationships again. Open the relationship window, and drag the id field from either dar or sub_dar (doesen't matter which way) and when the edit relatinship box is in view, check the "Enforce Referential Integrity" check box.

When all that's done, report back, and I'll probably wanna comment on the two other tables too;-)

(I'm probably due for some sleeping soon, but if I don't answer your next post as soon as you need, I'll be back tomorrow)

Roy-Vidar
 
Ok, that's done. Just to confirm, I've set a relationship between dar and sub_dar via the id field. It is a one to many.

And sleep is good, I'll be here tomorrow around 7am pacific time.



Knowlegeable enough just to cause serious problems.
 
Hey, you're fast;-)

Don't know nothing about pacific time, but I'll probably be up again in 7 hours...

Yes! A 1:M relationship!

The dar_officer and dar_toc table.

I suggest you add 'nother field to both tables. tocID to dar_toc and offID to dar_officer. Think both of them could have the datatype AutoNumber. Let them become the Primary Keys for the tables.

I'm wondering here - you have name in both tables - do you need that? (From your form, I see you try to hide the name in sub_dar - should name only be in dar?)

Well - add the fields tocID to the sub_dar table and offID to the dar table. Ensure that the datatype for both fields are Number with field size Long Integer.

Whith that, I think the name fields in both tables might be deleted. Just don't do it yet (for safety) and please do take backups at every step.

- friend of mine once told med that real men don't do backups, but often cry;-)

That OK?

Go to relationships again, and create relationship between dar_officer and dar, and between dar_toc and sub_dar (again checking "Enforce Referential Integrity").

If I'm not mistaken, this should produce a working db! Next steps would be the forms.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top