I have a minor problem with a subform
First of the all, the main form shows employees details and the sub form shows the work scheduled for that employee. I have binded the fields together.
It displays the first employees workschedule correctly in the sub form, however the problem is when i click on the next button the record in the subform does not update as well.
If it helps, this is the code i have so far....
Private Sub btnNext_Click()
UpdateRecords
rs.MoveNext
If rs.EOF Then
MsgBox "You have reached the last record", vbOKOnly, "Infomation"
rs.MoveLast
End If
FillControls
End Sub
Private Sub UpdateRecords()
txtClientName.SetFocus
rs.Fields.Item("Employee_Name") = txtClientName.Text
txtAddress.SetFocus
rs.Fields.Item("Address") = txtAddress.Text
txtTown.SetFocus
rs.Fields.Item("Town") = txtTown.Text
txtCounty.SetFocus
rs.Fields.Item("County") = txtCounty.Text
txtPostcode.SetFocus
rs.Fields.Item("Postcode") = txtPostcode.Text
txtTelephone.SetFocus
rs.Fields.Item("Telephone_No") = txtTelephone.Text
rs.UpdateBatch
End Sub
First of the all, the main form shows employees details and the sub form shows the work scheduled for that employee. I have binded the fields together.
It displays the first employees workschedule correctly in the sub form, however the problem is when i click on the next button the record in the subform does not update as well.
If it helps, this is the code i have so far....
Private Sub btnNext_Click()
UpdateRecords
rs.MoveNext
If rs.EOF Then
MsgBox "You have reached the last record", vbOKOnly, "Infomation"
rs.MoveLast
End If
FillControls
End Sub
Private Sub UpdateRecords()
txtClientName.SetFocus
rs.Fields.Item("Employee_Name") = txtClientName.Text
txtAddress.SetFocus
rs.Fields.Item("Address") = txtAddress.Text
txtTown.SetFocus
rs.Fields.Item("Town") = txtTown.Text
txtCounty.SetFocus
rs.Fields.Item("County") = txtCounty.Text
txtPostcode.SetFocus
rs.Fields.Item("Postcode") = txtPostcode.Text
txtTelephone.SetFocus
rs.Fields.Item("Telephone_No") = txtTelephone.Text
rs.UpdateBatch
End Sub