Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Location
    USA
    Posts
    66

    Unanswered: Disabling Subform

    Hi,
    I have a main form called sfrmHouseHold and a subform called sfrmApplicants. For every HouseHold there can be more than one applicant (one-to-many relation). I’m trying to force users to first enter HouseHold information before they enter applicant’s info. If they try, then a Message should come up saying something like “You must first enter HouseHold’s info…”

    I set the subform’s VISIBLE property to NO and on the main form I right clicked to HouseHoldFirstName’s field (since this is the first field to be filled) and choose property/Event tab, and put the following code, but the subform still wasn’t visible:

    Private Sub HholdFirstName_GotFocus()
    Forms![sfrmApplicant].Visible = True
    End Sub

    Thanks,
    DD

  2. #2
    Join Date
    Dec 2002
    Posts
    11
    A subform is not enumerated in the Forms collection unless it is opened by itself, so you cannot refer to it independent of the main form in this case. Think of it as a control on the main form. So,

    Forms![sfrmApplicant]

    Should be:

    Forms![frmHouseHold]![sfrmApplicant]

Posting Permissions

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