Solved Can not update. Database or Object is read-only (2 Viewers)

Gasman

Enthusiastic Amateur
Local time
Today, 13:19
Joined
Sep 21, 2011
Messages
14,041
Here is another pic....
You are looking in completely the wrong place? :(
You have an error in you concatenation as you have " WHERE plus you have no value for Me.EmpHOD, and even then I am only going on what was last posted.?

Heaven knows what you have now.
 

Ashfaque

Student
Local time
Today, 18:49
Joined
Sep 6, 2004
Messages
894
If I adds dbOpenDynaset it producing "Wrong Number of Arguments or Invalid property Assignment"
 

Ashfaque

Student
Local time
Today, 18:49
Joined
Sep 6, 2004
Messages
894
Gasman,
It was only idea that user enter the data in main form and subform (one to many) and after saving the record need manager's electronic approval. Just he enter his password and the control gets it relevant data from T_Dept and then record will save upon clicking Update btn on form.

But this taking lots of efforts because of my mistakes. Don t know what to do....
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:19
Joined
Sep 21, 2011
Messages
14,041
Gasman,
It was only idea that user enter the data in main form and subform (one to many) and after saving the record need manager's electronic approval. Just he enter his password and the control gets it relevant data from T_Dept and then record will save upon clicking Update btn on form.

But this taking lots of efforts because of my mistakes. Don t know what to do....
You have no value for Me.Me.EmpHOD ??? so the SQL is just nonsense and that is what access is complaining about.
 

Ashfaque

Student
Local time
Today, 18:49
Joined
Sep 6, 2004
Messages
894
You have no value for Me.Me.EmpHOD ??? so the SQL is just nonsense and that is what access is complaining about.
Gasman,

Thanks for your support. I found where was the problem. I will try fixing it.

I have value for Me.EmpHOD to bring from tbl. Thats what I am trying. My question is why is accepting single condition and runing smoothly and why not double condition. Because I had saved other records using one single condition of matching pwd only. Later on I decided to get data based on both conditions i.e. EmpHOD and PWDmgr as well. But it didnt work well. Why I know now.
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:19
Joined
Feb 28, 2001
Messages
26,998
Whenever an update doesn't seem to work, one thing I have found to be helpful is to copy the criteria (WHERE clause) onto a SELECT query that shows the same fields as you were trying to update. See if the SELECT returns any records. If it does not, your problem is probably an over-constrained WHERE clause. I.e. it filters out ALL records so there is nothing to update. That is a fairly simple experiment. The best part is that if you can fix the SELECT to return records, you then have the WHERE clause you need to drive the UPDATE query.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:19
Joined
Sep 21, 2011
Messages
14,041
Gasman,

Thanks for your support. I found where was the problem. I will try fixing it.

I have value for Me.EmpHOD to bring from tbl. Thats what I am trying. My question is why is accepting single condition and runing smoothly and why not double condition. Because I had saved other records using one single condition of matching pwd only. Later on I decided to get data based on both conditions i.e. EmpHOD and PWDmgr as well. But it didnt work well. Why I know now.
Your single criteria for Pwdmgr will work because you are supplying a value for it
Your double criteria would likely work as well IF you supplied a value for EmpHOD ?

Always check your SQL string with a Debug.Print
Even copy it from the immediate window to the SQL window and see if it works or complains, as The_Doc_Man mentions.
 

Users who are viewing this thread

Top Bottom