Results 1 to 12 of 12
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform Naming Almost (A2K)

    I'm attempting to delete a record using a popup modal form.

    MainForm Name: frm AGMExec
    Cheers,
    Andy

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

    Re: Subform Naming Almost (A2K)

    When you refer to a subform, you must always use the control name, not the name the subform has in the database window. Moreover, a subform is NOT part of the Forms collection. Try this:

    ="Are you sure you want to delete " & [SubPersonnel]![FirstLookUpBox]

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    Totally agree with your statement. But it did not work in this case. However, to attempt to clarify what I'm attempting here is what is happening.

    To hopefully clarify, the code works when dealing with the subform on its own, that is, I open the subform, do the Delete thing, the Modal Form pops up and all works.

    I think what's confusing the issue is that the "Do you want to delete message" and its Yes/No response buttons resides on another form ( popup modal ) called frmStandardDelete which is 'popped' up when the Delete button on the subform is clicked and that's where the 'referring' is crashing.
    Cheers,
    Andy

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

    Re: Subform Naming Almost (A2K)

    Could you try to provide a clear overview of the involved forms and subforms, and indicate where the code you are running resides?

  5. #5
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    It will be my pleasure, but unfortunately it won't be until tomorrow. Thanks again for responding. I'll try and put something together that actually makes sense.
    Cheers,
    Andy

  6. #6
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    I've attached a scaled down version of what I'm try to do. Please let me know if it needs further explanation.
    Cheers,
    Andy

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

    Re: Subform Naming Almost (A2K)

    Both 'frm AGMExec - Corp' and 'frm AGMExec - Corp - Sub 03 - Personnel' contain a control named FirstLookupBox. If you want to refer to the first one, use

    [Forms]![frm AGMExec - Corp]![FirstLookupBox]

    If you want to refer to the second one when 'frm AGMExec - Corp - Sub 03 - Personnel' is a subform on 'frm AGMExec - Corp', use

    [Forms]![frm AGMExec - Corp]![SubPersonnel]![FirstLookupBox]

    (SubPersonnel is the name of the subform 'frm AGMExec - Corp - Sub 03 - Personnel' as a control on the main form)

  8. #8
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    Thanks as always for such a quick response. I will get back to this after lunch. By the way, when exactly is it that you sleep?
    Cheers,
    Andy

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

    Re: Subform Naming Almost (A2K)

    Huh? <img src=/S/nosleep.gif border=0 alt=nosleep width=27 height=15>

  10. #10
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    Waikee! Waikee! Just long enough so that I can say thanks again. Once more has the nail been hit on the head,
    Cheers,
    Andy

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

    Re: Subform Naming Almost (A2K)

    That was a long lunch! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  12. #12
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Naming Almost (A2K)

    Hans,

    Cut me some slack! I was actually out working during that period of time. Lunch is a caloric luxury I try and do without. It's so much more fun sitting around coding my little fingers to the bone (after receiving your words of wisdom of course),
    Cheers,
    Andy

Posting Permissions

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