Look-Up Values that can be Subtotaled in other fields (1 Viewer)

bmhuettinger

Registered User.
Local time
Today, 09:03
Joined
Jul 28, 2017
Messages
59
Good morning! Super novice question, I think.

How can i add another value to this code:

Private Sub TagNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "frm_IPOAllocationWorksheet", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!frm_IPOAllocationWorksheet.TagNumber.Value = Me.TagNumber

End Sub

I.e. I'd also like to update the value of Forms!frm_IPOAllocationWorksheet.Net.Value to Me.Net (in the same record)
- I just can't figure out how to add it to the code.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:03
Joined
May 7, 2009
Messages
19,231
you passed it to the form as OpenArg parameter
of the Form, then on the Load Event of
the form that you opened, check for this value:

Docmd.OpenForm "yourForm",acNormal,,,,,Me.TagNumber


on the "yourform" Load Event:

Private Sub Form_Load()
if Trim(Me.OpenArgs & "") <> "" then Me.TagNumber=Me.OpenArgs
End Sub
 

bmhuettinger

Registered User.
Local time
Today, 09:03
Joined
Jul 28, 2017
Messages
59
Thanks for the quick response! I don't understand how this will populate the [net] field on my new form with the [net] value of the original form? Perhaps I didn't articulate my need properly - i already populate [tagnumber] but at the same time, i'd like to also populate [net].
B
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:03
Joined
May 7, 2009
Messages
19,231
Then pass the [net] to the form you are opening, just change the code to the correct field you want to pass and set.
 

bmhuettinger

Registered User.
Local time
Today, 09:03
Joined
Jul 28, 2017
Messages
59
So the purpose of my post was to determine how to "pass" the information.

Can I just add a line (obviously not, because i've tried it) or am I missing a comma, or space or an underscore or and ampersand....

Private Sub TagNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "frm_IPOAllocationWorksheet", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!frm_IPOAllocationWorksheet.TagNumber.Value = Me.TagNumber
Forms!frm_IPOAllocationWorksheet.net.Value = Me.net

End Sub

My level of Access knowledge was insufficient enough to not understand your first reply...unfortunately, the second reply to "just pass it", is even further beyond my comprehension.
 

Users who are viewing this thread

Top Bottom