Solved

Cannot Update subform but using updatable query

Posted on 2008-10-14
13
236 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
  • 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
 
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now