Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Problem with DAO Field UPDATE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Cosmas - 17 Nov 2006 23:43 GMT
I have created a recordset using a SELECT statement that looks like this,
using DBOPENDYNASET

Set prstTest = CurrentDb.OpenRecordset("SELECT 0 AS IsSelected, * FROM
QRY_CUSTOMERS")

Later in my code, I would like to change to change/UPDATE the ISSELECTED
column from a 0 to 1.  I used the .EDIT and set the value to 1, plus I added
the .UPDATE after I am done.  Unfortunately, the row/column did not not get
updated.  Help.

John
P.S. - The ISSELECTED is not part of the original table to QUERY; it is
added into the SELECT statement when opening the recordset
Allen Browne - 18 Nov 2006 10:49 GMT
John, this approach is not going to work.

You assigned a literal value to the field, but there is nowhere this value
is stored as Access pages the records in and out of memory.

You can verify that the field is not updatable like this:
   Debug.Print prstTest.Fields("IsSelected").DataUpdatable

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have created a recordset using a SELECT statement that looks like this,
>using DBOPENDYNASET
[quoted text clipped - 10 lines]
> P.S. - The ISSELECTED is not part of the original table to QUERY; it is
> added into the SELECT statement when opening the recordset
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.