Solved

Cannot Update subform but using updatable query

Posted on 2008-10-14
13
239 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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 Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

809 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