[VBA] Read-Only Property

Solved
jeate Posted messages 15 Status Member -  
blux Posted messages 2045 Registration date   Status Moderator Last intervention   -
Hello!

I am working on Access 2000 and I created a parent-child relationship between two forms, let's say between A and B.

Then, when I try to select a value in the field in my form B (which is dependent on my parent field), I receive the message "This property is read-only."

Even with "DoCmd.SetWarning False," the message still appears.

Does anyone know how I can disable this message or how I can avoid it?

Thank you!!!

7 answers

blux Posted messages 2045 Registration date   Status Moderator Last intervention   3 455
 
Hello,

if you're in read-only mode, and your subform is not of type 'add, modify', then I don't see what prevents clicking on it.

What exactly do you display in this subform?

--
A+ Blux
 "Stupid people dare to do anything. That's how you recognize them." 
0
jeate Posted messages 15 Status Member 3
 
Hello Blux! Well, I'm going to take a support subscription with you soon! lol

So listen, I can't remember where I can see the type of my form (add, modify), could you tell me so I can check if I can modify it?

Actually, I can click on it, but this message pops up, I click OK and then it takes into account the value I had selected.

But since it's a form where I'm adding contacts, it's annoying to always click on this error window!

So to explain what I have in my sub-form, here it is:

Main form
First Name Last Name Etc.

Sub-form
Name Application Services Note

And so, with the name field, which is a combo, I have a parent-child relationship. And when I want to insert something in my Application field (which is also a combo), then the message pops up. In fact, it displays no matter which field I choose in my sub-form, as long as it's a combo (because I don't get this error message with my text field Note)

Any idea? ;)
0
blux Posted messages 2045 Registration date   Status Moderator Last intervention   3 455
 
It must come from referential integrity constraints...

When you want to add something in the sub-form, the parent must be created, is that the case?

Anyway, displaying the name in the sub-form is useless, maybe you could remove it...

--
See you, Blux
 "Fools dare everything. That's even how you recognize them" 
0
jeate Posted messages 15 Status Member 3
 
Re!

So yes, the father-son relationship works well.

And the fact that I remove "Name" in my sub-form doesn't change anything; I still have the same error...

Oh, it's really a damn error... I don't know what to do...
0
blux Posted messages 2045 Registration date   Status Moderator Last intervention   3 455
 
I have never experienced this error (and yet I've seen quite a few)...

I'm puzzled...

If it's not a secret, I suggest you send me the database in .zip to the following address: denis point mail point list at free point fr

--
See you Blux
 " idiots dare everything. That's even how we recognize them" 
0
jeate Posted messages 15 Status Member 3
 
So I found the error, here’s the explanation:

Let’s say A and B are forms. G is a father-child relationship (let's say of the "Name" field) between my form A and B.

The “Read-only” error occurred when I had for example 10 names in my form A and only 3 in my form B, for example.

This caused an integrity problem (10 against 3), and that’s why I received this error!

Thank you for trying to help me!
0
blux Posted messages 2045 Registration date   Status Moderator Last intervention   3 455
 
It’s exactly what I imagined in my post 3: a problem of referential integrity.

That’s why, when I design a database, I try to be strict and create the relationships with ACCESS, which helps me make fewer mistakes...

Thank you for trying to help me!

Service...

--
See you later Blux
 "Fools dare to do anything. That's how you recognize them" 
0