J
Janet Ciegler
Another problem, please: Sometimes I need a form to add many records.
When many of the fields have the same value, I want the previous value
to appear on the next view of the form to tab over without retyping it.
If I design those fields as Unbound (Control Source is blank), then I
cannot request those to be filled in the Form_Activate sub, and have to
retype everything. But if I say the Control Source is the name of the
field, then whenever I start a new session of data entry, the first
record in the table is overwritten. (Within one session, only that one
record is overwritten.) So far I’ve not been able to put anything else
in the Control Source that the compiler will accept.
What I’m doing that causes the record to be overwritten is:
Private Sub Form_Activate()
ORDER.Value = strOrder
End Sub
Private Sub cmdOK_Click()
strOrder = ME!ORDER
DoCmd.Close
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblFamilies")
With rst
.AddNew
!ORDER = strOrder
.Update
.Bookmark = .LastModified
End With
When many of the fields have the same value, I want the previous value
to appear on the next view of the form to tab over without retyping it.
If I design those fields as Unbound (Control Source is blank), then I
cannot request those to be filled in the Form_Activate sub, and have to
retype everything. But if I say the Control Source is the name of the
field, then whenever I start a new session of data entry, the first
record in the table is overwritten. (Within one session, only that one
record is overwritten.) So far I’ve not been able to put anything else
in the Control Source that the compiler will accept.
What I’m doing that causes the record to be overwritten is:
Private Sub Form_Activate()
ORDER.Value = strOrder
End Sub
Private Sub cmdOK_Click()
strOrder = ME!ORDER
DoCmd.Close
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblFamilies")
With rst
.AddNew
!ORDER = strOrder
.Update
.Bookmark = .LastModified
End With