Open a form by variable

Reply

Join Date: Feb 2008
Posts: 3
Reputation: edsat is an unknown quantity at this point 
Solved Threads: 0
edsat's Avatar
edsat edsat is offline Offline
Newbie Poster

Open a form by variable

 
0
  #1
Feb 26th, 2008
hi there, I'm new here.
I have a problem to open a form with variable. Help me Please
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,086
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 125
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Open a form by variable

 
0
  #2
Feb 26th, 2008
Can you pass few more details on your exact requirment please.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Open a form by variable

 
0
  #3
Feb 26th, 2008
Hi esdat...specify more what the problem and show the effort friend .

ps : (welcome to daniweb)met datang di daniweb pak.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: Open a form by variable

 
0
  #4
Feb 26th, 2008
i think what he means is creating a function that would open a form through a varialble..

this is only my opinion about what he said...

Sample:

on the Click event of the button, i wanna close a form.. he prefers to call a function.
call CloseForm(variable)

sub Closeform(variable)
'the variable would trigger the open event of the form...
end sub
is that what you want? edsat?
Last edited by cometburn; Feb 26th, 2008 at 4:04 am.
Proud to be Philippine made...
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,086
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 125
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Open a form by variable

 
0
  #5
Feb 26th, 2008
Are you trying to do this
  1. Private Sub Command1_Click()
  2. Dim f As New Form1
  3. f.Show
  4. End Sub
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Open a form by variable

 
0
  #6
Feb 26th, 2008
hmmm. i got a same think like debasisdas
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 3
Reputation: edsat is an unknown quantity at this point 
Solved Threads: 0
edsat's Avatar
edsat edsat is offline Offline
Newbie Poster

Re: Open a form by variable

 
0
  #7
Feb 26th, 2008
I made a menu with ListView. when i doubleclick selected item on that menu, it must call form that i put the formname on a variable that call nAction

Private Sub ListMenu_DblClick()
Dim nAction As String
nAction = ListMenu.SelectedItem.SubItems(1)
?......
load a formname nAction ?
End Select
thank's
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,086
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 125
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Open a form by variable

 
0
  #8
Feb 26th, 2008
Then you can directly call the form with its corresponding event. But i am not sure what do you mean by I made a menu with ListView.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Open a form by variable

 
0
  #9
Feb 26th, 2008
  1. Private Sub ListView1_DblClick()
  2. Select Case ListView1.SelectedItem.Text
  3. Case "form1"
  4. form1.Show
  5. Case "form2"
  6. form2.Show
  7. ...
  8. Case Else
  9. MsgBox "ga ada yang diload"
  10. End Select
  11. End Sub
Last edited by Jx_Man; Feb 26th, 2008 at 6:49 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 3
Reputation: edsat is an unknown quantity at this point 
Solved Threads: 0
edsat's Avatar
edsat edsat is offline Offline
Newbie Poster

Re: Open a form by variable

 
0
  #10
Feb 26th, 2008
Makasih atas solusinya. Tapi mungkin ada ng command yang lebih singkat jika dalam menu tersebut ada puluhan item. Apa harus dibikin case sebanyak item tersebut. Bantuin dong jx_man. Trim's
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC