Results 1 to 6 of 6
  1. #1
    pedrocat is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    3

    Question deleteobject acform problem

    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?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe I just don't understand but why do you want to Delete the form rather than just closing it? Did you dynamically create it?

  3. #3
    pedrocat is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    3
    Thanks Ruralguy

    Thanks for your speedy reply .
    Correct. I create them on the fly. In the course of a day, there could be a dozen different reminders popping up. If I just use the AlarmPop form the reminder gets overwritten when the next one pops up.
    I have to delete them otherwise my database will expand exponentially, and on the next day, there will be a name clash as the system tries to create a new form with the same name as the one from another day.
    You could say I am trying to re-invent outlook's pop up reminders. The difference is that these reminders tie back to the contact record, so I have a history of the calls, meetings etc with a client. A variations od the CAT CRM system are used by my clients in the UK, and they are all waiting this new feature ... that is not quite ready! I would be very grateful if you could help.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I assume you do a Compact and Repair *every* time you close the db? Access is not real crazy about dynamically creating and seleting objects. Can't you just use the same form with a different message each time?

  5. #5
    pedrocat is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    3

    will try compacting

    I need multiple pop up forms (like in outlook). there could be more than one active reminders. and they should stay open until they are actioned.
    Are later versions of Access better at this?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you talking about the reminders (alarms) for the calendar in Outlook? The one in ac2010 lists all of the current alarms and allow you to put them back to sleep for some variable length of time. It that your idea?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with DoCMD.DeleteObject or IsObject
    By P5C768 in forum Programming
    Replies: 6
    Last Post: 11-30-2010, 12:14 PM
  2. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  3. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums