Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cannot Update subform but using updatable query

Posted on 2008-10-14
13
Medium Priority
?
246 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 85
ID: 22711051
Perhaps the form has been set to AllowEdits=False? Check this in the Form Design view, properties dialog, Data tab.
0
 
LVL 85
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 85
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 85
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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