ProgEvalJAA
MIS
I have a data entry form with three subforms. The form's fields of name, date, etc. are automatically populated from a table. The three subforms require data entry by the users.
If the user selects a record (on the main form) with an id of zero (meaning no record exists), I would like the three subforms to be disabled so the user cannot key any data into the subform.
If the user selects any other id number, the three subforms will need to allow data entry.
Currently, the subforms allow data entry on a record with an id number of zero, thus introducing erroneous information into my database.
I did not design this database, but I have found some code behind-the-scenes that reads as follows:
Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[KAMISID] = " & Str(Nz(Me![Combo4], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
However, this does not seem to work as the database allows data entry on a record with a id number of zero.
If the user selects a record (on the main form) with an id of zero (meaning no record exists), I would like the three subforms to be disabled so the user cannot key any data into the subform.
If the user selects any other id number, the three subforms will need to allow data entry.
Currently, the subforms allow data entry on a record with an id number of zero, thus introducing erroneous information into my database.
I did not design this database, but I have found some code behind-the-scenes that reads as follows:
Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[KAMISID] = " & Str(Nz(Me![Combo4], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
However, this does not seem to work as the database allows data entry on a record with a id number of zero.