Transferring Totals From Three Forms To A Final Form?
May 3, 2009
I'm taking my first (and only) beginning programing class for Visual Basics 2008. I'm working on my final project and have hit a snag. A little background info - I have been able to code everything except for two final steps (but they are my most difficult steps), on these final steps I've gotten two suggestions on other sites, one person helped me with the coding which I used for my form1, but it I still have several errors, and another person suggested that I use a module.
Here is the issue. I have totals on three forms that need to pass through to a final form, and once they are on the final form they need to show up in an itemized list and need to then be totaled again. I actually have a total of 5 forms including my first form aptly named form1, which incidentally is where someone told me I should set up my whole 'connecting the totals' form, and I believe the guy was on the right path with helping me but, I'm still obviously pretty lost on this last segment of coding. Since I had little difficulty with the majority of my project, I didn't think this last bit would be so difficult. I'm going to list my coding for each form below. My project is due Tue morning May 5th Eastern Standard Time, just in case someone starts reading this on or after that date. Just in case it helps explain the issue, I will also post my listing of error codes from my VB project, and they all are centered around my form1 (which is the form that I'm trying to set up the transfer through of the form totals). I also see that I can post attachments so in case it will help I'm going to post my project in the attachment too.
Error Codes:
Error1Event 'Load' cannot be found.
Error2Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
I've been working on a class project for quite a while, and I have not been able to figure out this step on my own. What I'm trying to do is connect the totals from three forms to a fourth page where I can then tally to those totals and then add 7% sales tax on the final total on the last page (I don't think I'll have a problem with the final part of add the 7% sales tax, but I'm not completely certain how to go about moving the totals through to that final form. Also, some of my forms use radiobuttons and one uses checkmark controls. I'm going to show some of the code that I have for each page in case this will make a difference. I think I need to do something with a public variable, but I'm not sure how to title that variable, and the public variable should have sub variable sections in each form, or if one specific public variable should be placed at the beginning of each form.I had also considering using a module to connect the totals in the forms together, because someone had suggested this, but I am not familiar at all with this method.
Code form1 Option Explicit On Option Strict On Option Infer Off
is there any way to populate a listbox with totals data from previous pages? I'm working on a project for a class where the final form needs to have all the totals from the previous 3 pages (each page has one total each), in some capacity (so I do not necessarily need to use a listbox if there is an easier way to do this).One thing about the previous 3 forms, two are set up in radiobuttons and one is set up w/a checkbox format (but I will likely change the radiobuttons over to checkboxes as a later revision).I just can't figure out how to populate the listbox with info from a previous form, I keep thinking load events, but that doesn't take into account which options might be taken from previous forms.once the totals from the previous forms have been added to the final form I will need to add a 7% sales tax. I assume that something such an if then statement will take care of that though.Just wanted to run that everyone here at the forum just in case there is a better way to do that.
I have 2 forms in this application. One form is just a simple SQL statement that is generated into a grid. It displays columns/rows. From there I want to be able to click on a row and have the first column of that row transferred to another form. In the second form I want it inputted into a text box. So, the user doesn't have to copy the record back out of the form then open the other form and paste.
The form opening and closing is not the problem. The problem is getting the data to transfer from one form to another!! I am not sure how to do it.. I have only been coding in VB for a few days and no formal training. I am aware of global variables and would be willing to assign the data to a variable and then have it transferred into the textbox of a the second form.
I do not know how global variables work in VB. This is what I got so far............ 'The user clicked the transfer button. Dim obj As System.Data.DataRowView = grid.Current MsgBox(obj.Item(0), vbInformation, "Selected Data") [Code] .....
How do I fire an event when changes are made in a datagrid embedded in my form? My datagrid houses line items for different forms (Sales Orders, Purchases Orders, etc.), and when a value is changed (i.e. quantity or price), I want it to re-calculate the datagrid automatically (extended amount) and also re-calculate totals in the form itself without having to hit the Save Button. Right now I have a sub-routine that fires when the button is chosen, but how do I fire this event automatically on datagrid changes?
when i clicked the final button to display my results "as string" it still showeed the number?? here is the code i wrote, is relativley simple, but the theory doesnt make scence to me Basicly its a box with 3 lables, (first name, surname and age), 3 text boxes (for the user to input this info) and a button at the bottom called "display in message box" so when i click the button, it displays the users input in the form as a message box. [code] what i dont get is if i said to VB that vaiable "Complete" was STRING then howcome it still displays the AGE which is an Integer (a number) not a string??
I'm relatively new to VB programming & My question was, how do you see the control source or rowsource of a text box so that you can make I display data. I have a case where I am trying to display sub-totals from an exce spreadsheet into a text-box on a User-form. And is it possible to make a selection in one listbox and have corresponding selection highlighted in another listbox?
i'm working on a project that is reading text from a file and displaying totals on my form.My issue is that everytime i press my btnCalculate Nothing Happens.Here is the File i am reading from which is in my debug folder.
So my question is that I have 2 list boxes in two forms aside from the main one. and I am trying to transfer what I choose in the side form to transfer to the list box.
several questions: Why does the blank list form I have in the main form create a problem when I enter a name for the list box and why does it appear in the box when I put it there? As you can see in my errors. It doesn't seem to recognize the listbox that I wanted to leave empty in the main form.
Second question is how do I get names to add in the main form list box. I believe I have the right code but I seem to be missing something else as well. I want the names to display in the main list box and the integers to add up together so I can separately figure the tax and shipping myself.
Here are some pictures and codes
Main:
Print:
Audio:
Public Class MainForm Dim frmAudioBooks As New AudioBooks Dim frmPrintedBooks As New PrintedBooks
How do you pass one radiobutton from form 2 to form 3? Iv tried:
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Form2.rbtnPatterned.Checked = True Then rbtnPatterned.Show() End If
But that doesn't work. The radiobutton selected in form 1 doesn't appear in form 2....
The first form in my project is a simple form for a shop selling cars. At the end of the form is a text box called txtTotal.text, this is the total cost of each sale. When I press the print button I not only want to print a sales invoice(I have that bit done) but I also want the total in txtTotal.text to be added to lblDaysTakings on my second form called frmAudit. Ive searched the web far and wide and cant find anything either suitable or within my level of understanding.
Ive tried code such as
Private Sub cmdPrint_Click() Dim curTotal As Currency Dim curDaysTakings As Currency
[code]....
and several other combinations but Im obviously a mile and a half off track as Im not getting anywhere?s a lot bigger than just the print button but I didnt see the point in posting the rest as I have everything else sorted out, its just transfering the numbers from one form to the other thats getting me.
Im having a problem when transfering values from form to form.Firstly I have a main menu form,click on a button to go to the dell components form.I choose the components for the computer and when i hit calculate the total is displayed in a textbox for my subtotal. When i press send it will send the sub total from the dell components form to the grand total and display it in the dell sub total in the grand total form.This part works ok, however, i go to the main menu and click on a button to go to the packardbell components form. Do the same again but when i press send, it will send the value to the grand total form in the packardbell sub total textbox but the value in the dell sub total textbox has vanished.Here is the code in the dell components form
Code: Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click Dim frm As frmGrandTotal = New frmGrandTotal(txtDellSubTotal.Text) Me.Hide()[code].....
Finally, the other problem im having is on the main menu form when I click on the view total button I get this error: Here is the code for this bit
Code: Private Sub btnViewTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewTotal.Click 'frmGrandTotal.Show() Me.Hide() End Sub
If I make the following array in a push button event and I want to put those array variables in a class array. How do I do that? I am just beginning to learn about classes in vb.net but I am having problems using classes and arrays.Is there any good tutorials on that subject.
I created a VBA project in Excel. I would like to figure out how to transfer the data back in forth to make a more presentable and user-friendly program in VB Studio.Basically, I need my form in VB to input data to into an excel �workbook.data�, where the calculations are preformed. Then I need to copy the finished excel data cells �workbook.results� and paste them into an end result form in VB. I have tried looking at threads and cannot come up with a solution. There is no data saved each time the program runs, so I don't have a database.
QuoteImports System.Data.OleDb Public Class admin Inherits System.Windows.Forms.Form Dim mypath = Application.StartupPath & "\db1.accdb" Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\db1.accdb;Persist Security Info=False;")
I have an assignment to create a website that people can use to make dinner reservations. We are using Visual Basic code for the forms. It's supposed to keep running totals of each type of dinner. I'm having trouble getting the running totals to not reset to zero. I have them declared outside of the button click event. Not sure where I went wrong. Here's the code:
Option Strict On Partial Class _Default Inherits System.Web.UI.Page
I have 10 Numericupdown boxes in my Form from numericupdown1 to numericupdown10. I would like to instantly display the total amount of all ten numericupdown in a Textbox (textbox1) on the form. I don't want to have to push a button to get the total value of the numericupdown boxes.
I have yet another question. I have set up a series of radioButtons to create a menu of choice for a class project and am trying to set it up so that there would hypothetically be a discount on a purchase of two or more t-shirts, I have the coding set up so that if any one item is checked and the calculate button is clicked, then the dollar value or "total" will show up, however I am not able to set up a total for more that one item, it clears the previous "total" and sets up a new total for the most recent t-shirt value checked.
Can anyone possibly take a look at my code (below) and tell me what I'm doing wrong? I have been sitting here for hours trying to figure it out. I'm very new at this and I'm thoroughly confused. I am using a book for Visual Studio "Programming in Visual Basic" and I have gone through all of the tutorials and code examples and followed them exactly (at least as far as I can tell). However, whenever I run the program, I am not getting the sum of the quantities I assigned to the constants showing up in"AccessoriesTxtBx" as I'm trying to. It shows up as $0.00 even when I have checked the boxes.[code]
How would you take a numerical input from 10 text boxes and total it up and send it to a label. Then average the 10 numeric text boxes and send it to its own label. I am not asking for any code, I just need a hint or two to jog my memory. If this is not clear for you, I'll provide more detail.
An ADOX (Access) database has five columns. ID, Date, Category, Store, Amount paid.It is possible to specify ten different items in the Category column: Apples, Oranges, etc.
I am very new to Visual basic. I don't know if I even have everything in the correct order. Here's my problem. I am trying to take user input on 3 input boxes, get discount from select case and then calculate out the following. My problem is I can get the code to do a simple addition, but If I try to do any calculation at all calling the discount I get an error where the output totals to zero. I don't know if I am missing something associated with the sub getDiscount() or if there is a problem elsewhere.Ultimately this is what I want my calculation to end up as.
First calculation Price * Entered Input * Discount = Full Discount Value Second Calculation Price * Entered Value - Full Discount Value = Total
this place looks pretty reliable and helpful so i thought i'd give it a shot.anyway, i'm a student looking for help. i have to write a program that calculates costs for a catering company. i have that part down, but whats stumping me is that i have to make a summary button that adds everything up into a grand total from the previous calculations and display it in a message box. displaying and calculations aren't really my issues, but getting the data to calculate is.
i have an idea of what to do i just don't know how to go about it. i know i have to store the data somewhere, but i dont' know how to keep adding it up so i can get a grand total, so i'm thinkin there needs to be something there to count.
Everything in my program is working correctly so far. The only problem I have is trying to update my totals for the program. I need to show total sales, total pay, and total commission for the program by using the file and then summary key. How the program works is that you get a base pay of $250 and you get a commission rate of .15 if you reach 1000 sales. I have done running totals before but not for one with multiple functions.
Option Strict On Public Class CommissionForm Const QuotaInteger As Integer = 1000 Const BASEPAYInteger As Integer = 250 Const COMMISSIONRATEDecimal As Decimal = 0.15D [Code] ......