I have a form that moves someone from one office to another. The form a combo box for the persons ID ([EmailID])and their new location ([NewLocation]) limited to only available locations.
Below it the code I currently have, but I have not been able to figure out how to copy other fields ([Phone] and [Analog Line]) from the current record to the new record without asking for the information in the form. I know that I am not currently deleting these entries from the old location. This is because I am leaving it in until I solve this problem.
Below it the code I currently have, but I have not been able to figure out how to copy other fields ([Phone] and [Analog Line]) from the current record to the new record without asking for the information in the form. I know that I am not currently deleting these entries from the old location. This is because I am leaving it in until I solve this problem.
Code:
DoCmd.SetWarnings (False)
DoCmd.RunSQL ("UPDATE tblOffice SET tblOffice.EmailID = Null, tblOffice.Available = -1 WHERE (tblOffice.EmailID)=Forms!frmMoveLocation!EmailID;")
DoCmd.RunSQL ("UPDATE tblOffice SET tblOffice.EmailID = [Forms]![frmMoveLocation]![EmailID], tblOffice.Available = 0 WHERE (tblOffice.[Office Number])=[Forms]![frmMoveLocation]![NewLocation];")
DoCmd.SetWarnings (True)
DoCmd.Close