Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


ATM Project - Displaying a Balance in a textbox depending on the PIN number entered


ATM Project - Displaying a Balance in a textbox depending on the PIN...

Author
Message
Sarah123
Sarah123
Forum God
Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)Forum God (435 reputation)

Group: Forum Members
Posts: 1, Visits: 5
Hi all,



I'm working on a project using VB 2010 Professional.

The project I'm building is an ATM project which has a log in form for customers where they enter their Name and their PIN number which are stored in an Access database that I have connected the project to.



I have the code working so that the Name and PIN that are entered must match the same customer in the database (eg. in the DB, John Doe's PIN is 1234 so on the login form John Doe can't enter anything other than 1234).

I'm using code like: "SELECT * from Account Where Customer_Name='" & UserNameTextBox.Text



This part of the project is working fine but I was wondering if anyone can help me with this problem: There is a button on the ATM form called btnBalance. When this is clicked I want the TextBox1 to show the Balance that is stored in the DB depending on which customer is logged in at the time. Can anybody help me with this?



Any help is appreciated, thanks! Also, sorry if I didn't word this very well, I'm a completely newbie with VB.



Destroyer
Destroyer
Forum God
Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)

Group: Forum Members
Posts: 244, Visits: 188
Hi Sarah,



Is the account balance stored in the same database table as the login info? Is so, you have already retrieved the balance for the logged in user with your Select statement below.



SELECT * from Account Where Customer_Name='" & UserNameTextBox.Text



Then it's just a matter of assigning the balance retrieved from the table via your Select statement to the textbox.



Something like, TextBox1.Text = rsBalance

Destroyer Smooooth
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search