Code to close form...

brum_rich

Rich
Local time
Today, 10:02
Joined
Jan 25, 2006
Messages
16
I need some code to close a form once i frmSelectEmployee contains a combo box and when the user selects a value from the list they will click on a command button to launch another form frmEditEmployeeDetails which displays the related record from the combox box.

On the command button I am using DoCmd.open form to launch the new form. Once the form is launched and showing the relevant record I want the procedure to also close the original form (the one with the combo box) and thought the attached code would do it but am getting a syntax error

DoCmd.OpenForm "frmEditEmployeeDetails"
DoCmd.Close (acForm,"frmSelectEmployee")

Any ideas?
 
Try:
DoCmd.Close acForm, Me.Name, acSaveNo
 

Users who are viewing this thread

Back
Top Bottom