BeneBarros Active Member Licensed User Longtime User Dec 28, 2014 #1 I have in SqlServer a table that contains the name and description of the forms that I use in a system. Is there any way to run the form with the name in a string variable ?. example: Currently do so. Code: Copy Dim lb as label = lstProg.Get (lstProg.SelectedIndex) formName = lb.tag Select Case formName Case "UserLogin" UserLogin.show (..., ..., ...) ... ... end select It has to do something like this? avoiding the Select case? Code: Copy Dim lb as label = lstProg.Get (lstProg.SelectedIndex) formName = lb.tag formName.show (... ....) thank you Last edited: Dec 29, 2014
I have in SqlServer a table that contains the name and description of the forms that I use in a system. Is there any way to run the form with the name in a string variable ?. example: Currently do so. Code: Copy Dim lb as label = lstProg.Get (lstProg.SelectedIndex) formName = lb.tag Select Case formName Case "UserLogin" UserLogin.show (..., ..., ...) ... ... end select It has to do something like this? avoiding the Select case? Code: Copy Dim lb as label = lstProg.Get (lstProg.SelectedIndex) formName = lb.tag formName.show (... ....) thank you
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2014 #2 Please use [code]code here...[/code] tags when posting code. You can create a Map that maps between the forms names and the forms: Code: Copy Dim forms As Map = CreateMap("Form1": Form1, "Form2": Form2, ...) ... Dim frm As Form = forms.Get(formName) frm.Show Upvote 0
Please use [code]code here...[/code] tags when posting code. You can create a Map that maps between the forms names and the forms: Code: Copy Dim forms As Map = CreateMap("Form1": Form1, "Form2": Form2, ...) ... Dim frm As Form = forms.Get(formName) frm.Show
BeneBarros Active Member Licensed User Longtime User Dec 29, 2014 #3 Erel said: Please use [code]code here...[/code] tags when posting code. You can create a Map that maps between the forms names and the forms: Code: Copy Dim forms As Map = CreateMap("Form1": Form1, "Form2": Form2, ...) ... Dim frm As Form = forms.Get(formName) frm.Show Click to expand... This me returning an error in frm.Show Attachments error.jpg 356.4 KB · Views: 458 Upvote 0
Erel said: Please use [code]code here...[/code] tags when posting code. You can create a Map that maps between the forms names and the forms: Code: Copy Dim forms As Map = CreateMap("Form1": Form1, "Form2": Form2, ...) ... Dim frm As Form = forms.Get(formName) frm.Show Click to expand... This me returning an error in frm.Show
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2014 #4 Form2 is a code module not a form. The code above will not work. Upvote 0