Referencing data while filling out a form.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thirdworld
    New Member
    • Sep 2007
    • 25

    Referencing data while filling out a form.

    I'm building my first database and I'm having trouble using data as a reference on different forms. Is there any way that data submitted by one form could be used immediately as a reference for filling out data in subsequent forms?
  • cyberdwarf
    Recognized Expert New Member
    • Nov 2006
    • 218

    #2
    You can pass data from one form to another in several ways
    1. Using the OpenArgs parameter of the DoCmd.OpenForm command, then using Me.OpenArgs in the load event of the opened form;
    2. You can retrieve data held on another form, using something like:-
      Code:
      MyValue = Forms!FormWithData.ScreenFieldname
    3. Any data saved to a table will be immediately available.
    HTH

    Steve

    Comment

    • Thirdworld
      New Member
      • Sep 2007
      • 25

      #3
      Sorry to be a bother Steve, but could you break that down for me. This is the development of very my first database and I have no programming experience. I mean those things literally.

      Comment

      • cyberdwarf
        Recognized Expert New Member
        • Nov 2006
        • 218

        #4
        Does the first form save data to your datatables? If so, you can immediately look up the saved data on subsequent forms.

        Does the first form open other forms? (eg, user presses a button). In this case, there will be VBA code behind the button Click event and this will contain the code to open the next form
        Code:
        DoCmd.OpenForm "NextForm", acNormal, , , , ,ValueToPass
        "ValueToPas s" can be a literal string, or a variable name. This value can be picked up in the Load event of the form being opened and used in any way you want.
        Code:
        Private Sub Form_Load()
        	 Dim PassedValue As Variant
        	 PassedValue = Me.OpenArgs
        End Sub
        HTH

        You should have a look at the articles and tutorials associated with this forum.

        Gotta eat now - will pick this up tomorrow, if you need more help.

        Steve

        Comment

        Working...