Hello all,
I got 2 userforms; Productionreturns and QA returns.
Both contain the same labels; lblGelcodeR and lblProductnameR.
Both contain the label info; if you click on it a new form opens: Information
The form Information contains the label lblGelCodeR and lblProductnameR. They should display the same data as on the forms Productionreturns and QA returns.
I use common variables for it;
On the form productionreturn;
on the form QAreturn;
And when the form information opens;
but this doesn't work. It works seperatly but not together. Seems logic since it gets the labels get info from 2 commonvariable if i read the code correctly. How can i change the code from the form Information that it looks if i click from QAreturn or Productionreturn and then use the right commonvariable?
I got 2 userforms; Productionreturns and QA returns.
Both contain the same labels; lblGelcodeR and lblProductnameR.
Both contain the label info; if you click on it a new form opens: Information
The form Information contains the label lblGelCodeR and lblProductnameR. They should display the same data as on the forms Productionreturns and QA returns.
I use common variables for it;
On the form productionreturn;
Code:
Private Sub lblInfo_Click()
commonVariable = Productionreturns.lblGelCodeR.Caption
commonVariable1 = Productionreturns.lblProductNameR.Caption
GelBMRProperties.Show
End Sub
on the form QAreturn;
Code:
Private Sub lblInfo_Click()
commonVariable2 = QAreturns.lblGelCodeR.Caption
commonVariable3 = QAreturns.lblProductNameR.Caption
GelBMRProperties.Show
End Sub
And when the form information opens;
Code:
Private Sub UserForm_Initialize()
lblGelCodeR.Caption = Productionreturns.commonVariable
lblProductNameR.Caption = Productionreturns.commonVariable1
lblGelCodeR.Caption = QAreturns.commonVariable2
lblProductNameR.Caption = QAreturns.commonVariable3
but this doesn't work. It works seperatly but not together. Seems logic since it gets the labels get info from 2 commonvariable if i read the code correctly. How can i change the code from the form Information that it looks if i click from QAreturn or Productionreturn and then use the right commonvariable?
Last edited: