Hi,
I've just started doing VB .net(my first programming language) at Uni.
I've got to create a basic ATM program with a login (with 4 pincodes set) which displays
the current balance (which is set in the coding) and you can deposit and withdraw money.
The changes to balance have to be saved while the program is running(I dont know if it does this automatically?)
and an admin account can view the total assets of all four users.
I'm not asking for complete code just a kick in the right direction. I've done the login screen and when you put your pin in it goes to the ATM screen but what I'm having trouble with is getting the pincode variable that has been entered (1111 or 2222 etc) onto the ATM so that I can use the set of variables I've set for each user(see second set of code) and when money is withdrawn/added saving that change in the program.
So basically
enter pin
load atm form (I dont know how to get the atm form to recognise the pin as a set variable from the previous form)
if pin = 1111 then
use user1111 variables
Also the txtpin.focus() doesn't focus the cursor in the box.
I'm a total newbie, I understand how things can work in VB I just don't know correct the syntax.
Let me know if I need to make things more clear.
If someone could guide me on how to do the things I've described it will be greatly appreciated
(Code Below vvvvvvvvvv)CODE
Dim pincode As String
pincode = CStr(txtpin.Text)
txtpin.Focus()
If pincode = ("1111") Or pincode = ("2222") Or pincode = ("3333") Or pincode = ("4444") Then
MessageBox.Show("Press Ok to Continue", "Pin Accepted")
ATMScreen.Show()
ElseIf txtpin.Text = "" Then
MessageBox.Show("Please Enter your Pin")
Else
MessageBox.Show("Incorrect Pin", "Error")
txtpin.Clear()
End If
This code is in a different form (ATMform) and it doesn't recognise pincode from the previous form.
CODE
Dim pinCode As String
Dim CurrentBalance As Double
Dim OverDraft As Double
If pinCode = ("1111") Then
CurrentBalance = 100.27
ElseIf pinCode = ("2222") Then
CurrentBalance = 53.21
ElseIf pinCode = ("3333") Then
CurrentBalance = -48.32
OverDraft = 100
ElseIf pinCode = ("4444") Then
CurrentBalance = 10.2
OverDraft = 500
End If