CsJHUN
Active Member
- Joined
- Jan 13, 2015
- Messages
- 360
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
- Mobile
Hi guys,
I would like to make a simpla so-called main form, where the user can select which form has to be loaded for him/her, and pass some values to them from "main form"
I found this method and tried to apply into my code
its not working, any advice welcome
I would like to make a simpla so-called main form, where the user can select which form has to be loaded for him/her, and pass some values to them from "main form"
I found this method and tried to apply into my code
Code:
Private Sub btn_frmOpen_Click()
Dim frm As Object 'also tried with Userform
'search for process
o_folyamat = Sheets("Rules").Range("1:1").Find(what:="Folyamatok:", lookat:=xlWhole).Column
'get how many process is in the list
frmname_row = Sheets("Rules").Range(columns(o_folyamat).Address).Find(cb_folyamat.Text).Row
'get the form name based on the value
frmname = Sheets("Rules").Cells(frmname_row, o_folyamat + 1).Value
' and here comes the debug
Set frm = CallByName(UserForms, "Add", VbMethod, frmname)
'follow values would be passed from main to selected form
frm.tb_date.Value = tb_date.Value
frm.cb_ShiftAC = cb_ShiftAC
frm.cb_sor = cb_sor
frm.cb_folyamat = cb_folyamat
'hide main and show selected form
Me.Hide
frm.Show vbModeless
End Sub
its not working, any advice welcome