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?
Referencing data while filling out a form.
Collapse
X
-
Tags: None
-
You can pass data from one form to another in several ways- Using the OpenArgs parameter of the DoCmd.OpenForm command, then using Me.OpenArgs in the load event of the opened form;
- You can retrieve data held on another form, using something like:-Code:
MyValue = Forms!FormWithData.ScreenFieldname
- Any data saved to a table will be immediately available.
Steve -
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
-
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"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:DoCmd.OpenForm "NextForm", acNormal, , , , ,ValueToPass
HTHCode:Private Sub Form_Load() Dim PassedValue As Variant PassedValue = Me.OpenArgs End Sub
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.
SteveComment
Comment