Re: Bank Simulator ~ Help
(sniff)
(sniff sniff)
I smell a class project
(sniff)
I smell a lazy student
(sniff)
I smell donuts! MMMMMM donuts...bye :-P
Re: Bank Simulator ~ Help
It is a class project, im not lazy i need help...
And donuts are bad 4 u!:lol:
Re: Bank Simulator ~ Help
I'll help you if you give me some freakin' donuts. I love donuts, and I'm not even fat.
No one is going to do the code for you, but we'll help. Do you have any code done so far?
Re: Bank Simulator ~ Help
Almost everything that's bad for you tastes good...even cyanide (slightly bitter, but it's made from apple pips so I assume has an appley taste...Mmmmmm, apple cyanide :-))
Anyway, if you're doing the class project and you've been given a project that is too hard for you to do, shouldn't you speak with your tutor about it? We *could* talk you through it, but the stuff you are asking is elementary programming...it's stuff the tutor should have taught you before giving you such an assignment :-P
Re: Bank Simulator ~ Help
Well there is alot of forms...
and when u press enter or w.e to get in the bank this is the coding:
Private Sub cmbbalances_Click()
Balances.Visible = True
End Sub
Private Sub cmdcancel_Click()
FrmStart.Visible = True
Unload Me
End Sub
Private Sub cmddeposit_Click()
deposit.Visible = True
Unload Begin
End Sub
Private Sub cmdwithdraw_Click()
Withdraw.Visible = True
Unload Begin
End Sub
on the DEPOSIT the coding is:
Private Sub cmd20_Click()
'THE CODE GOES HERE THAT I NEED LOL'
End Sub
Private Sub cmdcancel_Click()
Unload Me
Begin.Visible = True
End Sub
Private Sub Form_Load()
End Sub
Yea i need to know how to add 20 bucks on the account balance
Re: Bank Simulator ~ Help
assuming account balance is lblBalance you would use lblBalance.caption = val(lblBalance.caption) + 20
Re: Bank Simulator ~ Help
You need a public-scope variable. This is a variable that can be accessed by any form/module in your project.
Add a module to your project. Add something like:
Public sinBalance As Single
Then save it. That will be the variable you use in your project to store the current balance. You can manipulate that in the forms. ie:
Subtract $20 from the balance:
sinBalance = sinBalance - 20
To add:
sinBalance = sinBalance + 20
To display:
Label1.Caption = "$" & Format(sinBalance, "00.00")
Format formats the total balance in dollar format, ie: $20.00
Edit: or do what Smux said and work with it directly from a label.:p
Re: Bank Simulator ~ Help
hmm not sure if that is working, the balance is in a different form than the deposit.. so do i still use the same coding?
^^ for the post b4 the one ontop of this
ill read the one new person made
Re: Bank Simulator ~ Help
uhh its kinda hard with the module , what i want to do is :
I go click 20 on deposit, i t will show 20 bucks on a textbox on the same form, then when i click done, it will it add it to balances, therfor when i click done, it goes back to the menu where its deposit withdraw balances and ****, and when i click balances it will show me the RIGHT balance right now its 1000 and i want it to be 1020 when i clickd that 20$
Re: Bank Simulator ~ Help
if the balance is on a different form, add the form name to the info...I said lblBalance.caption above, now let's assume it's on form1, you would put form1.lblBalance.caption instead :-)
Re: Bank Simulator ~ Help
Private Sub cmd20_Click()
txtmoney = Val(lblbalance.Caption) + 20
End Sub
like that or?
Re: Bank Simulator ~ Help
if txtmoney is updated with lblBalance, yes...but it all depends on your form's layout :-P
Re: Bank Simulator ~ Help
Private Sub cmd20_Click()
lblbalance = Val(lblbalance) + 20
End Sub
lblbalance is located at Balances.frm
and cmd20 is located at deposit.frm
It still dosent add up to the lblbalance
Re: Bank Simulator ~ Help
ah, then you'd probably want
frmBalances.lblBalance.caption = Val(frmBalances.lblBalance.caption) + 20
Although this is all dependant on what the form is named *IN* the project...click on the form and look in properties
Re: Bank Simulator ~ Help
OOOOOOOOOOOOOOOOOO SWEET yo thx alott tttt :D i yea its not frmbalances its just balances yeeeeeee thx more questions coming soon :P
Re: Bank Simulator ~ Help
Hmmm, when i click deposit 20 and look at balances it says 1020 im like okay, i went back and added another 80, all it says is 1080, it wont add to it, it will tell u what u recently added, i want it to add alltogether
the coding on deposit is
Private Sub cmd100_Click()
Balances.lblbalance.Caption = Val(Balances.lblbalance.Caption) + 100
End Sub
Private Sub cmd20_Click()
Balances.lblbalance.Caption = Val(Balances.lblbalance.Caption) + 20
End Sub
Private Sub cmd40_Click()
Balances.lblbalance.Caption = Val(Balances.lblbalance.Caption) + 40
End Sub
Private Sub cmd80_Click()
Balances.lblbalance.Caption = Val(Balances.lblbalance.Caption) + 80
End Sub
Private Sub cmddone_Click()
Unload Me
Begin.Visible = True
End Sub
and balances code is just
Private Sub cmdcancel_Click()
Unload Me
Begin.Visible = True
End Sub
Re: Bank Simulator ~ Help
Don't forget to mark this one as resolved (and maybe give me some rep :-P)
Re: Bank Simulator ~ Help
wait answer that question plz and it isnt resolved some questions i ask b4 werent answer, just answer the one b4
Re: Bank Simulator ~ Help
There's no reason why pressing 80 and 20 wouldn't add 100...You might have to paste the whole project (form and other stuff) as an attachment so we can take a look
Re: Bank Simulator ~ Help
Is this assignment intended as an exercise on simply making GUI or an exercise on maintaining relevant data structures (eg. an array that contains transactions). If its the second case then you shouldn't be making GUI dependent calculations, GUI should be for data entry and display only... in line with the concept of n-tier design.