Pass Info from 1 form to the next (1 Viewer)

snirben

Registered User.
Local time
Yesterday, 17:15
Joined
Nov 26, 2016
Messages
33
Hi Guys,
i need your help.

I have a form with my products,

Sort By ID,Maintype,Subtype,Kgm


so i make in macro on "Dblclick" to take the id that have been chosen and past it to another form, The problem is , first it doesnt paste the ID in the subform of a form. Second my form is a subfrom inside a form .

Code:
Private Sub ID_DblClick(Cancel As Integer)

  strDocName = "FirstRequestView"
   
  DoCmd.OpenForm strDocName, acFormDS, , , , , Me.ID
End Sub


the form with the subform:



So this is what i want to happen:
When i go to the Form i click on a button that take me to a Tab inside the tab i have subform with list of products . i want to click on the first field and then the form with my products will open and i can choose the Product by double clicking and then the ID will paste in the subform inside a form(and a tab) and then a new field will start.




UPDATE:

so right now i was able to enter my MainForm and then to the Tab where my subform and when i click on something in the datasheet the product form opens,
now i want to chose a producat ID and it will fill it to the subform, and when i want to add 1 more it will add it and not overwrite it.

so this is all i need right now. can someone help me?
 
Last edited:

moke123

AWF VIP
Local time
Yesterday, 20:15
Joined
Jan 11, 2013
Messages
3,934
Code:
DoCmd.OpenForm strDocName, acFormDS, , , , , Me.ID
from your code above, it appears you are passing the ID as your OpenArgs argument. Try using
Code:
=OpenArgs
as the default value of the control you are looking to populate.
 

snirben

Registered User.
Local time
Yesterday, 17:15
Joined
Nov 26, 2016
Messages
33
Code:
DoCmd.OpenForm strDocName, acFormDS, , , , , Me.ID
from your code above, it appears you are passing the ID as your OpenArgs argument. Try using
Code:
=OpenArgs
as the default value of the control you are looking to populate.

Sry can you be more specific, i am new to access.

you want me to add =Openargs to the code?

or change the default value of the control you are looking to populate. you mean the "ID" in the Subfrom?

but how can i make him take the ID from the form and past it on the ID in the open curret form. and when i chose the next one it not overwrite, but add one more to the list in the subform?
 

Users who are viewing this thread

Top Bottom