How do I make my form run a query when it comes up?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sueb
    Contributor
    • Apr 2010
    • 379

    How do I make my form run a query when it comes up?

    I have a form in which I want to pre-select a certain defined subset of my database's records every time it gets opened.

    I know this can be done because I've seen forms that do this, but I've been unable to figure out how to make this happen. Even investigating the forms that do this, I was unable to find the "magic link."
  • colintis
    Contributor
    • Mar 2010
    • 255

    #2
    In simple way, select your table or query that you want to display in the form, then click on create form button.

    A bit complex way, in the form property --> Data, select the table in the record source by selecting the table/query. Then to those particular field, do the same to select the table fields from the property's control source.

    Comment

    • sueb
      Contributor
      • Apr 2010
      • 379

      #3
      Thanks for this response.

      However, the first thing I looked to was the form's Properties/Data tab, but I found it to be entirely blank! Have I done something wrong in my form to cause this to be unavailable to me?

      Comment

      • mshmyob
        Recognized Expert Contributor
        • Jan 2008
        • 903

        #4
        Check the OnLoad event and see if there is any code there.

        cheers,

        Comment

        • sueb
          Contributor
          • Apr 2010
          • 379

          #5
          My form has only the following events:

          On Click
          On Dbl Click
          On Mouse Down
          On Mouse Move
          On Mouse Up

          Comment

          • slenish
            Contributor
            • Feb 2010
            • 283

            #6
            That would be the detail section on your form. Open up the properties box then there should be a drop down where can select form...and not detail.

            Comment

            • sueb
              Contributor
              • Apr 2010
              • 379

              #7
              That was it! Thanks, everyone!

              Comment

              Working...