|
-
Apr 4th, 2001, 05:25 PM
#1
Thread Starter
Junior Member
Thanks for taking the time out to post the code and an explanation Surfdemon, it worked!! greatly appreciated
Claire
-
Apr 4th, 2001, 07:51 PM
#2
Hyperactive Member
It's my distinct pleasure.
My only question is, why aren't you in the pub at this late hour. (My excuse is that I'm 7 time zones away)
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 5th, 2001, 09:48 AM
#3
Hyperactive Member
Oh! Bye the way, you don't have to delete your threads after you've finished with them, other people might find them useful, but are too shy to ask 
Of course, you can delete them if you want (it's entirely up to you).
Have fun, (and get out of the computer lab and into the pub! It's unhealthy for a student to be sober after 9pm). Tell 'em the surf demon sent you.
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 5th, 2001, 11:35 AM
#4
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Apr 5th, 2001, 12:23 PM
#5
Thread Starter
Junior Member
I still can't get the 2 decimal place thing to work.
I went to the pub after last night and i'm just after getting back now!!
If i can get the 2 decimal bit workin' i'll be done. Can you help?
Im trying to divide a decimal number in one text box with a whole number in the second box.
when i tab out of the second box it displays the answer in a third box.(amount)
The answer is coming up like this ##.########### and saves it to the database like that. Im dealing with money in an account so I want the amount to save to the database like this ##.##
Please help Surfdemon - you sound like a genius!
Thanks,
Claire
-
Apr 5th, 2001, 12:26 PM
#6
PowerPoster
Code:
txtAmount.Text = FormatCurrency(Text1.Text, 2)
Last edited by Lethal; Apr 5th, 2001 at 12:29 PM.
-
Apr 5th, 2001, 12:31 PM
#7
Thread Starter
Junior Member
Where?
Thanks but where exactly do I put that. Your dealing with a real beginner here!!
-
Apr 5th, 2001, 12:34 PM
#8
PowerPoster
Since I do not fully understand your situation, you can format your data directly with the textbox. There is an option called dataformat property for the textbox control, you could just set that to Currency.
-
Apr 5th, 2001, 12:36 PM
#9
Thread Starter
Junior Member
I tried that but it didn't work,
I'll mess around with it for a bit and come back if i still can't get it to work,
Thanks for your help,
Claire
-
Apr 5th, 2001, 12:38 PM
#10
PowerPoster
What didn't work. The dataformat?? I'm assuming that you are using an access database with the data field set to Currency. Using the dataformat prop, you can specify how your data will appear to the user. Should work, I just tested it.
-
Apr 5th, 2001, 12:40 PM
#11
Hyperactive Member
Oh you smooth talking devil!
How can I possibly not answer a compliment like that, even if it is untrue.
Try this.
Put three text boxes on a form
txtFirstNumber, txtSecondNumber and txtAmount
Now put this code in the validate event for txtSecondNumber
Code:
Private Sub txtSecondNumber_Validate(Cancel As Boolean)
Dim curAmount As Currency
curAmount = CCur(Val(txtFirstNumber.Text) / Val(txtSecondNumber.Text))
txtAmount.Text = Format$(curAmount, "$0.00")
End Sub
Now get back to drinking Guinness before they go on strike!
If it doesn't work, or do what you want, then let me know.
Cheers,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 5th, 2001, 12:42 PM
#12
Hyperactive Member
Of course you can change the $ in the format bit that says "$0.00" to a pound sign. This keyboard doesn't have one.
Cheers,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 8th, 2001, 10:39 AM
#13
Thread Starter
Junior Member
Sorry 'bout the delay in replying - must have been all the dhrink over the weekend dulling my interest in sittin' infront of the computer again.
Anyway, im back now and I got it to work at last.
i was just puttin the format code in the wrong place. Woops!
Thanks Lethal and Surfdemon!!
Im sure ill have a few more questions for you soon!
Claire
-
Apr 8th, 2001, 11:19 AM
#14
Hyperactive Member
Anytime Claire!
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|