By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,101 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,101 IT Pros & Developers. It's quick & easy.

Help with Visual Studio & opening windows with buttons

P: 2

I am new to Visual Studio and VB and am stumbling along but have hit a roadblock. I am attempting to build a very basic database application that needs to 1) allow input & manipulation of data into a table via a small interface and 2) output data to a report and allow for printing. My goal is to help with uniform ordering for the kitchen staff at the restaurant at which I work.

Thusfar I have created Uniform_Order_App.vb, which builds successfully and functions properly (i.e., allows input, stores data in the table properly, and saves new entries). This Uniform_Order_App form contains several fields and a button. This button is from whence my problems stem! I have also created UniformReport.rdlc (which I suppose will show me the data I have input in the layout I have specified). I have also created a windows form and dropped a ReportViewer into it. I have named this form ReportViewerX.vb and have left it unchanged from the defaults set up by Visual Studio. The code for that form is here:
Expand|Select|Wrap|Line Numbers
  1. Public Class ReportViewerX
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         'TODO: This line of code loads data into the '_uniform_order_backwards_compatable_DataSet.Order_Sheet_1' table. You can move, or remove it, as needed.
  5.         Me.Order_Sheet_1TableAdapter.Fill(Me._uniform_order_backwards_compatable_DataSet.Order_Sheet_1)
  7.         Me.ReportViewer1.RefreshReport()
  8.     End Sub
  9. End Class
The aforementioned button,Button1, is supposed to open the ReportViewerX form, but it fails to do so. I don't particularly care if the Report opens in the same window as the interface or in a new window.

I have tried using the following code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim ReportViewerX As New Form
  4.         Me.ActivateMdiChild(WindowsApplication1.ReportViewerX)
  7.     End Sub
as suggested by one of the posts that I read, but nothing happens when I click the button. I have tried a few other things (which ones, I must admit I have forgotten).

Am I on the right track, or am I way off base? Any help would be greatly appreciated. I am in no real hurry and am willing to try whatever suggestions you may have.

Thank you in advance!
Apr 3 '07 #1
Share this Question
Share on Google+
1 Reply

P: 2
I forgot to mention that it is Visual Studio 2005 that I am using...

Thanks again!

Apr 3 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.