Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

access 2003 rocrds not deleted, data is read only

Posted on 2010-09-05
13
Medium Priority
?
773 Views
Last Modified: 2012-06-21
I've read numerous forums none of which work.
(Access 2003 with Jet dB)

I have a form with a subform within it.
The form programatically sets the record source for the subform.
Thi works fine. only the selected records are displayed.
However, when I go to manually delete one of the records I get the message "records not deleted, data is read only' in the status bar.
Ive checked the permission on the DB. In fact if I go to the table directly I can delete it OK.
The table I display has no joins. It also has a single field primary key which is also unique.

Here's my sql

Dim strsql As String
strsql = "SELECT record_id, user, batch_num, product, barcode, description, quantity FROM tbl_Data "
strsql = strsql & "WHERE (User='" & CurrentUserName & "')"

Me.tbl_Current_Batch_subform.Form.RecordSource = strsql

CAn anyone help.
It must be something simple or stupid.
0
Comment
Question by:EWHTLC
  • 5
  • 3
  • 3
  • +1
13 Comments
 
LVL 9

Expert Comment

by:TonyReba
ID: 33607164
How are you trying to delete the records? Do you get a Read Only message when
starting the database?
0
 
LVL 9

Expert Comment

by:TonyReba
ID: 33607173
0
 
LVL 75
ID: 33607205
On the subform form ... what are the following Form properties set to:

Allow Edits
Allow Deletions

?

Are you using code to Delete?  If so, where and what ?

mx
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:EWHTLC
ID: 33607279
Tony, I've already looked at that answer and it doesn't apply here.

To delete the record I am simply highlighting the selection bar on the left of the row. AS soon press my delete on the keyboard the message is displayed in the status bar.

On the subform. THe allow edits and allow deletions are both set to 'yes'. In fact I've tried all combinations.

There is one peculiar. When I set the record type to dynaset, the records do not get selected on the subform. I have read that it needs to be dynaset to be able to delete.

Any ideas ?
0
 
LVL 75
ID: 33607298
"be dynaset to be able to delete."
Definitely. Or Dynaset (Inconsistent Updates)

Sure sounds like the subform's recordsource is Not updatable for some reason.

Can you:

1) Compact & Repair (*** to shrink the size),

2) Zip up the MDB (*** to further shrink the size)

3) Attach the file for upload here (using the 'Attach File function below) ... removing any sensitive data of course.

4**** And please give a clear explanation of exactly how to reproduce the problem or what you are trying to do.

NOTE:  If you have an A2007 ACCDB, please convert to A2003 MDB.
mx
0
 
LVL 44

Expert Comment

by:GRayL
ID: 33607505
When you say you are setting the recordsource of the subform programatically, do you mean only CurrentUserName changes or in fact the table and fields.  If only the CurrentUserName changes, you should be using tblData directly as the recordsource, and controlling the link using LinkMasterFields and LinkChildFields set to CurrentUserName.
0
 
LVL 44

Expert Comment

by:GRayL
ID: 33607511
also, if CurrentUserName is the name of the field in both tables and it is also the name of the text box in the main form, that will create a problem.  Change the name of the textbox to txtCurrentUserName.
0
 

Author Comment

by:EWHTLC
ID: 33607516
OK,
I've zipped it up and attached it.
I've go rid of hat I can
If you open it up for modification (open with shift key)
Ther eare some network links in there

run the startup form (not startform)
username eric password eric
It will then take you into a form with the subform on it.
The subform will contain 4 records.
Select any one of the records and try to delete it.
The message appears in the status bar at the bottom.

Cheers

Eric
2nds-to-Whse.zip
0
 
LVL 75
ID: 33607539
The Recordset Type is being set to Snapshot somewhere.  That is your issue.

mx
0
 
LVL 75
ID: 33607575
What's odd is ... if you set it to Dynaset, then no records are displayed ....

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1200 total points
ID: 33607591
OK ... you have the Subform Data Entry property set to Yes.  Set to No ... and Recordset Type to Dynaset ... and it works.

mx
2nds-to-Whse-MX01.zip
0
 
LVL 44

Assisted Solution

by:GRayL
GRayL earned 800 total points
ID: 33607655
In addition, you can get into trouble if you leave the Microsoft default control name the same as the field name to which it is bound.  Best to prefix it with something indicating the type of control.  You did it in a couple of places in the main form but your subform is problematic.  Have a look at www.acc-technology.com/namconv.htm
0
 

Author Closing Comment

by:EWHTLC
ID: 33607686
Thanks Guys.
I know it would be simple.
I think I've just been looking at it for too long now and couldn't see the woods for the trees.

Thanks for your time. It now works a treat
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question