Form is read only even though query behind it is editable

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.
smoore6809Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Check the AllowEdits propery - is it set to No?

mx
0
 
smoore6809Author Commented:
set to yes
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
SheilsCommented:
You have to check and make sure that allow edit and allow addition is set to yes in both the form and subform
0
 
smoore6809Author Commented:
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
 
smoore6809Author Commented:
they are both set correctly
0
 
SheilsCommented:
can you type in the subform when you open it outside the form
0
 
smoore6809Author Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I know the query works, but can you post the SQL for the query?

mx
0
 
smoore6809Author Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
ok ... so, you cannot type into any fields?  Or select any thing from any combo box?

mx
0
 
Rey Obrero (Capricorn1)Commented:
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
 
smoore6809Author Commented:
I get an error compile error named argument not found
0
 
smoore6809Author Commented:
please see attached
Doc2.doc
0
 
Rey Obrero (Capricorn1)Commented:
hmm...editing disconnected recordset,  me thinks will not work in continuous  or datasheet view of a form..
0
 
smoore6809Author Commented:
What do you suggest?
0
 
Rey Obrero (Capricorn1)Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.