unclesvenno
Programmer
Greetings,
I am trying to close a form (frmLoading) from another form (frmCostings). Here is my code within frmCosting's Form_Load event:
I get an error message reading "An expression you entered is the wrong data type for one of the arguments"
Also I would like to add in a test to ensure the form (frmLoading) is open before trying to close it as frmCostings is used frequently and frmLoading is only used on start up.
Thanks,
Unlce Svenno
I am trying to close a form (frmLoading) from another form (frmCostings). Here is my code within frmCosting's Form_Load event:
Code:
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Dim rst As Recordset
Dim Msg As String
Set rst = CurrentDb.OpenRecordset("wDefaultAO", dbOpenDynaset)
If rst.EOF Then
Else
rst.MoveFirst
Forms!Costings!ActionOfficer = rst!ActionOfficer
Call SetCostingList
End If
rst.Close
Me!CostingDate = Date
'----Add test here-----------
' This is the line causing me the trouble
DoCmd.Close acForm, Forms!frmLoading
'----Close test here---------
Exit_Form_Load:
Exit Sub
Err_Form_Load:
MsgBox Error$
Resume Exit_Form_Load
End Sub
I get an error message reading "An expression you entered is the wrong data type for one of the arguments"
Also I would like to add in a test to ensure the form (frmLoading) is open before trying to close it as frmCostings is used frequently and frmLoading is only used on start up.
Thanks,
Unlce Svenno