Hi,
I've encoutered really strange error in both microsoft access query design and in excel vba adodb.
Updateable query looks like this:
For some strange reason, error is "Operation must use an updateable query."
I've tested this query in Microsoft Access and I can view it in "Datasheet view" but when I try to run it from Access Objects, it gives the same error.
My Assumption is that Access have issues when using parameters like TOP 1 and DESC, so it might require Temporary table with sorted data.
Could anyone provide answer? If that's so, could anyone create that kind of query or fix this one, so in future I can look for a way to do it myself
I've encoutered really strange error in both microsoft access query design and in excel vba adodb.
Updateable query looks like this:
Code:
strSQL = "UPDATE tbWorkplanPNs " & _
"SET tbWorkplanPNs.Version = ( " & _
"SELECT TOP 1 tbWorkplanRevision.Version " & _
"FROM tbWorkplanRevision " & _
"WHERE tbWorkplanRevision.Workplan = tbWorkplanPNs.Workplan " & _
"ORDER BY tbWorkplanRevision.[Current Date] DESC " & _
") WHERE tbWorkplanPNs.Workplan = '" & .myvalue.Value & "'"
conn.Execute strSQL
For some strange reason, error is "Operation must use an updateable query."
I've tested this query in Microsoft Access and I can view it in "Datasheet view" but when I try to run it from Access Objects, it gives the same error.
My Assumption is that Access have issues when using parameters like TOP 1 and DESC, so it might require Temporary table with sorted data.
Could anyone provide answer? If that's so, could anyone create that kind of query or fix this one, so in future I can look for a way to do it myself