Can't link forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • davegb

    Can't link forms

    I'm creating a simple, or at least it should be simple, database to
    track the employees in our group. I've created a switchboard form, and
    want to put a button on it to open the form in which we can add new
    employees. It's a simple form with the employee's name (first and
    last), phone number, cubicle, title, etc. Some of these fields are
    drop-down selections, like "cubicle".
    When I try to assign this form to the button in the wizard, I get a
    message saying, "You have chosen forms that can't be linked. You must
    have at least one field that can be linked on each form."
    I don't understand this at all. Why would a form have to have a field
    in common with a switchboard? The switchboard has no "fields", only a
    title, a graphic and some buttons (hopefully) to access other forms.
    There are no fields to associate. Does anyone have any ideas why I'm
    getting this frustrating message?
    TIA

  • pietlinden@hotmail.com

    #2
    Re: Can't link forms

    You don't need to link this form. IF all you want to do is open a form
    for add/edit or whatever, you can just use

    DoCmd.OpenForm "FormName",acEd it...<or whatever>

    AFAIK, you can only open a linked form from a bound form. So you'd
    pass the unique record ID to the linked form... that's what they mean
    by linked.

    Comment

    • Steve

      #3
      Re: Can't link forms

      Have you accidentally created a subform on your switchboard form?
      Access may think you are trying to link a main form with a subform.

      Instead of using the wizard, why don't you try just opening the
      switchboard form in Design View and adding one by doubleclicking the
      Button object on the toolbar? Then you can right-click the button that
      is inserted into your form and, in the Click event, place:

      DoCmd.OpenForm "frmMyFormsName "

      This code will open frmMyFormsName when the button is clicked.

      Comment

      • davegb

        #4
        Re: Can't link forms


        pietlin...@hotm ail.com wrote:[color=blue]
        > You don't need to link this form. IF all you want to do is open a form
        > for add/edit or whatever, you can just use
        >
        > DoCmd.OpenForm "FormName",acEd it...<or whatever>
        >
        > AFAIK, you can only open a linked form from a bound form. So you'd
        > pass the unique record ID to the linked form... that's what they mean
        > by linked.[/color]

        Thanks for your reply. I'm not trying to link the form, Access is
        telling me to. When I tell the wizard to open this form, it says it
        can't because it can't be linked. There's no option to tell it not to
        link, at least not any obvious one. Can I override this action somehow
        and open the form from the switchboard?

        Comment

        • davegb

          #5
          Re: Can't link forms


          Steve wrote:[color=blue]
          > Have you accidentally created a subform on your switchboard form?
          > Access may think you are trying to link a main form with a subform.
          >
          > Instead of using the wizard, why don't you try just opening the
          > switchboard form in Design View and adding one by doubleclicking the
          > Button object on the toolbar? Then you can right-click the button that
          > is inserted into your form and, in the Click event, place:
          >
          > DoCmd.OpenForm "frmMyFormsName "
          >
          > This code will open frmMyFormsName when the button is clicked.[/color]

          Thanks! There was no subform, but your instructions to just create the
          button and assing the VBA worked great! Why was Access making this so
          difficult?

          Comment

          • Steve

            #6
            Re: Can't link forms

            The only suggestion I have for that without seeing exactly what you
            were doing is that the wizard may have thought you were attempting to
            create a linked subform instead of a button. This would cause it to
            therefore give you an error like you received.

            Although I don't really understand why the wizard would think you were
            trying to create a new form...the wizard that appears when you start
            working with a new button is pretty specific to button actions and I
            don't believe it can be used to do anything other than work with button
            events.

            Comment

            • davegb

              #7
              Re: Can't link forms


              Steve wrote:[color=blue]
              > The only suggestion I have for that without seeing exactly what you
              > were doing is that the wizard may have thought you were attempting to
              > create a linked subform instead of a button. This would cause it to
              > therefore give you an error like you received.
              >
              > Although I don't really understand why the wizard would think you were
              > trying to create a new form...the wizard that appears when you start
              > working with a new button is pretty specific to button actions and I
              > don't believe it can be used to do anything other than work with button
              > events.[/color]

              Exactly. I have no idea why it thought the forms had to be linked. Or
              how it could think I was creating a form. But I'm getting used to
              surprises from Access! Seems like when I try to do the simplest things,
              I get all kinds of error messages.

              Comment

              Working...