View Full Version : Code to close form...


brum_rich
11-08-2008, 07:23 AM
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?

Singh400
11-08-2008, 08:56 AM
Try without the brackets?

RuralGuy
11-08-2008, 08:59 AM
Try:
DoCmd.Close acForm, Me.Name, acSaveNo