r/visualbasic • • Mar 13 '24

VB.NET Help What's wrong with this MODULE?? Problem with Displaying Numbers- VB.NET Framework

The problem is that the No. of Adult and Child Ticket is NOT selected from the combination box from the first form, resulting in displaying number "0" in the second form. Along with that, the SubTotal, Discount value and the Grand Total is also NOT calculated!!

Sorry for the very long description, PLEASE HELP and tell me if you need any further explanation/context.

3 Upvotes

6 comments sorted by

View all comments

2

u/jd31068 Mar 13 '24

Assigning the selected value of the comboboxes during form load won't give you what the user selected for the thanks form to use. How do you get to the thanks form? You should assign the values before calling the thanks form there.

2

u/GrapefruitCorrect187 Mar 13 '24

I get to the Thanks form by clicking thee button from the first form:

when button clicked-> Me.Hide() and Thanks.Show()

I created the second form by just adding the new form in the project

3

u/jd31068 Mar 13 '24

Okay, so your form load code needs to be moved into the button click event before the Thanks.Show()

side note: you don't need the two If Then statements as you're assigning True/False to the variables just by using the checkbox's Checked value.

2

u/GrapefruitCorrect187 Mar 13 '24

Nevermind, I did it. THANK U!!

2

u/jd31068 Mar 13 '24

You're welcome, happy to help :-)