ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing the values of variables (https://www.excelbanter.com/excel-programming/302319-changing-values-variables.html)

mickiedevries[_6_]

Changing the values of variables
 
Okay I'm trying to build a program that a user selects from a bunch o
choices on user forms and the last user form displays the part numbe
of the selections and the total price.

Right now I have all my variables that contain the prices for each ite
on the module1 code page, all declared as public so the all of the use
forms can use them. This works fine and does what it's suppose t
however I want another screen from which the orginal prices from eac
part can be changed if needed.

I set up another user form that assigned the contents of the textboxe
that the user enters input into to the variables, but it doesn't updat
them. I'm wonder if I need to use ByRef, but I'm not exactly sure ho
to do this. Below I've posted some sample code from my module1 page
userform1 page, and my pricing userform.

Thanks for any help.

Mickie

Module1 page code

Public curList As Currency
Public strPart As String
Public curListHV_10 As Currency
Public curListHV_20 As Currency

Public Sub List()
curListHV_10 = 100
curListHV_20 = 200

End Sub




UserForm1 page code

Private Sub HV_10_Click()
If HV_10 Then
Call List
curList = curList + curListHV_10
strPart = "HV-10-"
End If
End Sub

Private Sub HV_20_Click()
If HV_20 Then
Call List
curList = curList + curListHV_20
strPart = "HV-20-"
End If
End Sub

Private Sub OK_Click()
Me.Hide
Motor.Show
End Sub



Pricing User Form Code

Public Sub Submit_Click()
curListHV_10 = Val(Me.HV_10TextBox1.Text)
curListHV_20 = Val(Me.HV_20TextBox.Text)
Me.Hide
updated.Show
End Su

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com