Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Form is read only even though query behind it is editable

Posted on 2008-10-22
17
Medium Priority
?
316 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
  • 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
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.

 

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

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!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
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. …

916 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