Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Phantom form (2002 SP3)

    I have a form, frmBKzAttendance, acting as an attendance role that is based on a crosstab query. As the date range and thus the number of dates (Col headings) can vary as per user selection, I have to re-build the form every time it is used. That
    Regards,
    Peter

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Phantom form (2002 SP3)

    Is there an object variable that refers to the form that hasn't been set to Nothing? Something like

    Dim frm As Form
    Set frm = Forms!frmBKzAttendance
    ...

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Phantom form (2002 SP3)

    Wish there was, but no. Wierd eh?
    Regards,
    Peter

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Phantom form (2002 SP3)

    You wrote that if you resume and back up a few steps, IsLoaded is False. What happens if you then try to execute the DoCmd.CopyObject line again?

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Phantom form (2002 SP3)

    Makes no diff. Here is the part of the code that I'm talking about.
    Regards,
    Peter

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Phantom form (2002 SP3)

    Is that code called from frmBKzAttendance itself? If so, even if you close the form, it will remain in use until the code finishes, so you have a conflict.

  7. #7
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Phantom form (2002 SP3)

    Yep!
    I'll try this. Get frmBKzAttendance to open a dummy form whose only function would be to run this code on an OnOpen Event, then close. Unless you have a more sophisticated (simple) solution.
    Regards,
    Peter

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Phantom form (2002 SP3)

    That should work, and is probably the easiest method. The dummy form can be hidden (specify acHidden as WindowMode argument in DoCmd.OpenForm)

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Phantom form (2002 SP3)

    Thanks Hans.
    Can't see acHidden as an open argument. But I made the form 0 high x 0 wide, so it isn't seen.
    Regards,
    Peter

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Phantom form (2002 SP3)

    The instruction

    DoCmd.OpenForm FormName:="frmDummy", WindowMode:=acHidden

    or

    DoCmd.OpenForm "frmDummy", , , , , acHidden

    will open the form frmDummy invisibly. Look up OpenForm in the Access VBA help form more info (click in the word OpenForm and press F1)

  11. #11
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Phantom form (2002 SP3)

    Well I'll be danged! There the little critter was hiding all the time. I've never tried to look past 'Filter' in the list of arguments.
    Once again the depth of your knowledge is awsome.
    Thanks and thanks again.
    Regards,
    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •