Solved

Cannot Update subform but using updatable query

Posted on 2008-10-14
13
241 Views
Last Modified: 2008-10-26
I have a subform that is based on an updatable query. I can go into the query itself and do modifications, but cannot on the form itself. The field I am trying to update is not locked or disabled. Any ideas?
0
Comment
Question by:smoore6809
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
13 Comments
 
LVL 84
ID: 22711051
Perhaps the form has been set to AllowEdits=False? Check this in the Form Design view, properties dialog, Data tab.
0
 
LVL 84
ID: 22711059
Sorry ... glossed over the "subform" part.

Is your subform properly linked to the mainform (i.e. the Master/Child linkfields are properly set for the subform control)? This can cause your subform to behave like this as well.
0
 

Author Comment

by:smoore6809
ID: 22711078
Allow edits is set to true. The subform is not linked to the main form. The main form is unbound and strictly uses combo boxes, text boxes etc. to filter information for the subform.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 84
ID: 22711131
When you make edits, can you actually make the edit, but it doesn't save, or does Access not allow you to make the edit at all?

Are you showing the status bar? If not, enable it and see if Access is providing any information ... Access uses this sometimes to alert you to issues.

Any code running the Enter/GotFocus/Activate events of that control (or any other events, for that matter)?
0
 

Author Comment

by:smoore6809
ID: 22711172
ok so it says the form is read only
0
 
LVL 75
ID: 22712630
On the subform - Form property sheet ... Data tab:

Set the Recordset  Type to Dynaset (Inconsistent Updates)

mx
0
 

Author Comment

by:smoore6809
ID: 22712691
setting recordset type did not help
0
 
LVL 75
ID: 22712712
What error are you getting?

Can you post the SQL for the subform Recordsource?

mx
0
 

Author Comment

by:smoore6809
ID: 22712850
I am getting the error form is read only.
Here is the code that populates the subform:
  DoCmd.Hourglass True
    strSQL = "Select * " _
         & "    from qryBuyerReport "
    Set cnn = New ADODB.Connection
    cnn.Open pstrConnectionString
    Set rs = New ADODB.Recordset
        With rs
                  .Open Source:=strSQL, _
                  ActiveConnection:=cnn, _
                  CursorType:=adOpenKeyset, _
                  LockType:=adLockOptimistic
           'CursorLocation:= adUseClient
            If .RecordCount = 0 Then
             MsgBox "No Records Found"
            Else
              Set Me.objSubform.Form.Recordset = rs
              Me.objSubform.Form.Requery
            End If
            .Close
        End With
    Set rs = Nothing
    Me.cboItem = ""
    Me.cboVendor = ""
    Me.cboChain = ""
    Me.cboCategory = ""
    Me.chkPassover = 0
    Me.txtBuyerCode = ""
    Me.cboSubCat = ""
    DoCmd.Hourglass False
    cnn.Close
    Set cnn = Nothing
0
 
LVL 84
ID: 22715893
You must use the adUseClient CursorLocation with this method ... you've got it commented out for some reason.
0
 

Author Comment

by:smoore6809
ID: 22719447
When I put that back in I get the error message "Named argument not found."
0
 

Author Comment

by:smoore6809
ID: 22730464
Can anyone help me with this?
0
 

Accepted Solution

by:
smoore6809 earned 0 total points
ID: 22767324
I waited for someone to help, but nobody could give me an answer. I solved the problem myself.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

733 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