[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Windows Forms in Visual Basic

Posted on 2011-09-06
4
Medium Priority
?
423 Views
Last Modified: 2013-11-27
I want to create a button in Form 1 that will open up Form 2 in Windows Application. I have the button on the form already but can't get Form 2 to open up.
0
Comment
Question by:lovemycomputers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:Daelt
ID: 36487595
Did you try this? :

Private Sub cmdPoste_Click()
    DoCmd.OpenForm "Form2"
End Sub

Open in new window

0
 
LVL 1

Accepted Solution

by:
adamlonsdale earned 2000 total points
ID: 36487928
Double click the button on your form to show the code view. You should enter the following code

Dim frm as new Form2
frm.Show

Open in new window

0
 
LVL 40
ID: 36490107
Forms do not come automatically in VB now. You need to create a variable in order to use a form.

I suggest that you get use to that way of working, because it gives lot a better control of what is happening in the application.

If you are in a rush of simply an amateur programmer however, you can work as you did before by using the following syntax:

My.Forms.Form2.Show
My.Forms.FormAnything.Show
My.Forms.FormAnother.Show
0
 
LVL 2

Expert Comment

by:JAVI1065
ID: 36498731

Dim myvariable as new Myform()

myvariable.show()
or
myvariable.showdialog() "for modal open"
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question