Hello All
This is my first post! I have been working with Access since Version 2, and have stuck with DAO and version 2000 format databases.
I have CRM customer management database, which includes an action diary attached to the contact table.
I can set an action for a specific time in the day.
When the time comes, CAT (my system) copies the standard AlarmPop form to Alarmpop856 (856 being calculated form the exact time)
I make the call or whatever, then close the form.
When the form closes, the form should be deleted.
but it wont....
The code is like this.
On click of BtnClose on the form
Private Sub BtnClose_Click()
‘ grab the form name and set it as a
gAlertForm = Me.Name
DoCmd.OpenForm "AlarmPopDel", acNormal, , , , acHidden
End sub
On open AlarmPopDel
I seem to need this hidden form to make the form close
Private Sub Form_Open(Cancel As Integer)
Dim iForm As String
iForm = gAlertForm
DoCmd.Close acForm, iForm
fncAlarmClose
End Sub
So far so good – the AlarmPop856 closes
Function fncAlarmClose()
Dim iForm As String
iForm = gAlertForm
DoCmd.DeleteObject acForm, iForm
gAlertForm = ""
DoCmd.Close acForm, "AlarmPopDel"
End Function
It stops at the DeleteObject
With error 2008, can’t delete AlarmPop856 while it is OPEN.
Really weird, because the form is definitely closed
Any ideas as to how to force the form to delete?