Making a Form ReadOnly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monicarana
    New Member
    • Nov 2006
    • 3

    #1

    Making a Form ReadOnly

    Hi All,

    I have a form with a field "ID" and a View Button. I am calling another form on the press of a view button, the called form should display the data corresponding to the ID field in the first form. I want the second form to be readonly. I am using the below code

    Private Sub cmdView_Click()
    strLinkCriteria = "[Request ID] = Forms![Form1]![subform]![Request ID]"
    DoCmd.OpenForm "Form2", , , strLinkCriteria
    DoCmd.MoveSize (1440 * 0.1), (1440 * 0.1)
    Forms![Form2].Form.Recordset Type = 2

    End Sub


    But when i press the view button, it always fetches the first row of the table. And the form is read only. If i remove the line Forms![Form2].Form.Recordset Type = 2, then the record is displayed correctly but its editable.

    Please let me know how to go about it.

    Regards,
    Monica
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    There is a property "Allow Edits" in the form design properties window which may be of use. I don't know what the equivalent is in code, though.

    Comment

    Working...