12 Replies - 32656 Views - Last Post: 24 February 2012 - 09:44 PM Rate Topic: -----

#1 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

vb code to launch a new form when button is clicked

Posted 22 February 2012 - 10:40 AM

hi! im a newbie here and with visual basic. i'm not a programmer and anything related with IT. i'm trying to create a program for my internet cafe wherein i would need 2 forms, 1 which will contain the transactions and 1 to log in/out customers. I was able to make this using excel but am currenty having a hard time now creating the program with VB2010, because syntax/formulas seemed different from that of excel2010... i have so many questions that i would like to ask, but i'l start with loading a form(for logging in/out) by clicking the Log-in button.

what i used before when i created a userform in excel is this:
Private sub LogBut_Click()
logForm.show
End sub

i tried the above and changed .show to .load but it ddn't work. I'm totally lost... Please help..

thanks,
roan

Is This A Good Question/Topic? 0
  • +

Replies To: vb code to launch a new form when button is clicked

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13482
  • View blog
  • Posts: 53,820
  • Joined: 12-June 08

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 10:46 AM

Quick question - are your customers going to be using this or is this for your book keeping?
Was This Post Helpful? 0
  • +
  • -

#3 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 11:03 AM

if you're totally new to programming then I suggest the best (prolly the only) option is to learn it first. Better be familiar with the basics first rather than just blindly diving in and start coding a program. The resource page here on DIC will get you up and running.

This post has been edited by nK0de: 22 February 2012 - 11:04 AM

Was This Post Helpful? 1
  • +
  • -

#4 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 11:19 AM

View Postmodi123_1, on 22 February 2012 - 10:46 AM, said:

Quick question - are your customers going to be using this or is this for your book keeping?



this is just for my own use..
Was This Post Helpful? 0
  • +
  • -

#5 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 11:32 AM

View PostnK0de, on 22 February 2012 - 11:03 AM, said:

if you're totally new to programming then I suggest the best (prolly the only) option is to learn it first. Better be familiar with the basics first rather than just blindly diving in and start coding a program. The resource page here on DIC will get you up and running.

thanks! i'll check it out :)
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13482
  • View blog
  • Posts: 53,820
  • Joined: 12-June 08

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 11:56 AM

Okay so if that's the case then you would want to pickup a book on VB.NEt and work through it. I can only imagine how god awful confusing thrashing around in the dark must be.

In any case - assuming your two forms are label something like 'form1' and 'form2' you would want to create an instance of your form2 and then 'show' it.

Something like this:


'-- form1's button click start 

Dim frm2 As New Form2
frm2.Show()

'-- form1's button click stop



Was This Post Helpful? 1
  • +
  • -

#7 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 225
  • View blog
  • Posts: 1,526
  • Joined: 16-March 11

Re: vb code to launch a new form when button is clicked

Posted 22 February 2012 - 03:11 PM

You definitely need to understand the fundamentals of Object Oriented Programming. This will help you understand keywords like "New", and what a form, button, or any controls and thousands of classes ultimately are. If I'm not mistaken Excel is a bit more VB6ish, and those days are long gone.
Was This Post Helpful? 0
  • +
  • -

#8 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 23 February 2012 - 10:10 PM

View Postmodi123_1, on 22 February 2012 - 11:56 AM, said:

Okay so if that's the case then you would want to pickup a book on VB.NEt and work through it. I can only imagine how god awful confusing thrashing around in the dark must be.

In any case - assuming your two forms are label something like 'form1' and 'form2' you would want to create an instance of your form2 and then 'show' it.

Something like this:


'-- form1's button click start 

Dim frm2 As New Form2
frm2.Show()

'-- form1's button click stop




thanks a lot! it's working... :)
Was This Post Helpful? 0
  • +
  • -

#9 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 23 February 2012 - 10:16 PM

View Posttrevster344, on 22 February 2012 - 03:11 PM, said:

You definitely need to understand the fundamentals of Object Oriented Programming. This will help you understand keywords like "New", and what a form, button, or any controls and thousands of classes ultimately are. If I'm not mistaken Excel is a bit more VB6ish, and those days are long gone.


yeah, that's right.. That's why am havin a hard time with vb2010, i'm used to excel's vba codes which i've learned from school 10-12 years ago when i was still in college. hehehe, it's quite embarassing though.. when i made the userform in excel everything was working perfectly but when i tried vb2010,I gt lost! but thanks a lot anyway! i have a lot to learn..
Was This Post Helpful? 0
  • +
  • -

#10 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 225
  • View blog
  • Posts: 1,526
  • Joined: 16-March 11

Re: vb code to launch a new form when button is clicked

Posted 23 February 2012 - 10:28 PM

It won't take you very long trust me, it's not as complex as it seems.
Was This Post Helpful? 0
  • +
  • -

#11 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 24 February 2012 - 04:27 AM

View Posttrevster344, on 23 February 2012 - 10:28 PM, said:

It won't take you very long trust me, it's not as complex as it seems.

thanks for the support! i really appreciate it. :)
another request, can you tell me where i can find a tutorial here on how to transfer values from my textboxes, radiobuttons, and listboxes to a listview... i've been searching for the tutorial but can't find it. made 3 forms, 1 for my login w/ pword and my reliever's, 1 with the listview(transaction log) and one with the textboxes,etc.., my only problem right now is transferring the values to the listview and inserting a countdown timer and countup timer..

thanks in advance! :)
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13482
  • View blog
  • Posts: 53,820
  • Joined: 12-June 08

Re: vb code to launch a new form when button is clicked

Posted 24 February 2012 - 06:48 AM

Have you read much up on listviews?

(hint there's a nice example after the treasure trove of information on the various methods of a list view)
http://msdn.microsof...=vs.100%29.aspx
Was This Post Helpful? 1
  • +
  • -

#13 guizoecale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 22-February 12

Re: vb code to launch a new form when button is clicked

Posted 24 February 2012 - 09:44 PM

View Postmodi123_1, on 24 February 2012 - 06:48 AM, said:

Have you read much up on listviews?

(hint there's a nice example after the treasure trove of information on the various methods of a list view)
http://msdn.microsof...=vs.100%29.aspx



Thank you so much! I think you really are a good mentor, u can give advise and solution and also point where i can learn things that i need to know.. Thank u! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1