Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form is read only even though query behind it is editable

Posted on 2008-10-22
17
Medium Priority
?
313 Views
Last Modified: 2011-10-19
Why would my form be read only, even though I can edit the query that the form is based on? The form is a subform that is not linked to the master because it is populated based on what is selected in comboboxes on the main form. I fill the recordset of the subform programmatically based on what is selected. I can edit the query but cannot type into fields. The subform is enabled and not locked.
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
  • 8
  • 4
  • 3
  • +1
17 Comments
 
LVL 75
ID: 22779598
Check the AllowEdits propery - is it set to No?

mx
0
 

Author Comment

by:smoore6809
ID: 22779616
set to yes
0
 
LVL 16

Expert Comment

by:Sheils
ID: 22779632
You have to check and make sure that allow edit and allow addition is set to yes in both the form and 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!

 

Author Comment

by:smoore6809
ID: 22779636
Here is an example of one of the combo box after update fields on the main form:

Private Sub txtBuyerCode_AfterUpdate()
  psWhereClause
  strSQL = "Select * " _
        & "    from qryBuyerReport " _
        & "   Where " & strWhere
          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 = ""
          DoCmd.Hourglass False
          cnn.Close
          Set cnn = Nothing
    'Me.frmDetail_SubTotal.Visible = False
End Sub
0
 

Author Comment

by:smoore6809
ID: 22779657
they are both set correctly
0
 
LVL 16

Expert Comment

by:Sheils
ID: 22779670
can you type in the subform when you open it outside the form
0
 

Author Comment

by:smoore6809
ID: 22779686
No, but I think it is because I don't set the recordsource until the main form is opened, so if I open it by itself I get #Name? in all of the fields
0
 
LVL 75
ID: 22779718
I know the query works, but can you post the SQL for the query?

mx
0
 

Author Comment

by:smoore6809
ID: 22779743
SELECT dbo_tvwBuyerReport.*, IIf([allowtype]="" Or IsNull([allowtype]),0,1) AS ysnAllow, IIf(IsNull([POQty]),0,1) AS ysnPO, IIf([ysnPO]=1 Or [ysnAllow]=1,1,0) AS ysnCmd, IIf([DaysAvailable]<>0,Round(([DaysAvailable]*[avg8wks]/5)-[qtyonhand]+0.49),"") AS DaysAvail
FROM dbo_tvwBuyerReport;
0
 
LVL 75
ID: 22779775
ok ... so, you cannot type into any fields?  Or select any thing from any combo box?

mx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22779927
try this changes, see if it will make any difference

          Set rs = New ADODB.Recordset
              With rs
                              .Open Source:=strSQL, _
                        ActiveConnection:=cnn, _
                        CursorType:=adOpenStatic, _
                        LockType:=adLockBatchOptimistic, _
                CursorLocation:= adUseClient
0
 

Author Comment

by:smoore6809
ID: 22779957
I get an error compile error named argument not found
0
 

Author Comment

by:smoore6809
ID: 22779971
please see attached
Doc2.doc
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22780158
hmm...editing disconnected recordset,  me thinks will not work in continuous  or datasheet view of a form..
0
 

Author Comment

by:smoore6809
ID: 22780171
What do you suggest?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 22780243
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22780263
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

721 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