Changing records on a Form

A

Amy Moody

I have an inventory control program to track the items that are issued to
employees. I currently have a form that is loaded based on a popup form with
an unbound control. This form shows all the equipment issued to a particular
vehicle by utilizing the unit number assigned to the vehicle. I would like
to be able to have all the records related to this unit number change when
the employee id is changed on one of the items. This will prevent the user
from having to make numerous changes to items and will prevent errors (I hope)
..
My popup form uses an unbound combo box which points to a query. When the
user selects one of the unit numbers in the combo box and clicks okay, the
form containing the information is displayed in a continuous form. If the
user wishes to change an employee assigned to an asset, a msg box appears
asking if they are certain they wish to make the change, if the user selects
yes, another form opens to to track the change (history) and filled out
automatically. Upon exiting the history update form, I would like for the
next record related to the unit number to also change and the history of that
item to be updated. I'm sure there is a way to do this, but it has been a
VERY long time since I have done any serious programming in Access and I am
stumped.

Here is the code to do the change. I have it set in the BeforeUpdate
property.

Private Sub chrEmpID_BeforeUpdate(Cancel As Integer)
If MsgBox("Are you sure you want to change this employee?", vbYesNo Or
vbQuestion) = vbYes Then
DoCmd.OpenForm "frmAddComments3", , , , acFormAdd
Forms!frmAddComments3!Comments.SetFocus
Else
Me.Undo
End If
End Sub


Any help or suggestions would be greatly appreciated.

Thanks in advance.....
Amy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top