View Full Version : Visual Basic
dddriveman
10-03-2004, 10:17
:confused: Please help me. I am writing a program in visual basic to create invoices for a future fictional buissness. I cannot find any sample code of cash registers. If you have any please tell me
:Thanx:
VB isn't my speciality, even though I do know some. What exactually do you want? Do you want a sort of interface like a cash register, code that processes functions that a cash register might have, etc.?
deltacoder1020
10-03-2004, 12:30
:confused: Please help me. I am writing a program in visual basic to create invoices for a future fictional buissness. I cannot find any sample code of cash registers. If you have any please tell me
:Thanx:
try www.vbexplorer.com and www.freevbcode.com for samples.
Astronouth7303
10-03-2004, 15:09
:confused: Please help me. I am writing a program in visual basic to create invoices for a future fictional buissness. I cannot find any sample code of cash registers. If you have any please tell me
:Thanx:
I do lots o' VB. (just ask about MSCOMM.) :cool:
What do you mean by "sample code of cash registers"? Also, what edition and version of VB are you using? EE has a bunch of helpful controls. And how do you plan to store data about products? Like name, ID, price, etc. And what 'distribution' method are you going to do? LAN, DDE, multi form, what?
All of this effects what you use and how you do it.
dddriveman
11-03-2004, 09:10
I do lots o' VB. (just ask about MSCOMM.) :cool:
What do you mean by "sample code of cash registers"? Also, what edition and version of VB are you using? EE has a bunch of helpful controls. And how do you plan to store data about products? Like name, ID, price, etc. And what 'distribution' method are you going to do? LAN, DDE, multi form, what?
All of this effects what you use and how you do it.
I am just trying to click on commmand buttons that say Robot COntroller or Battery and they list the price in a picture box. I have all of that done but i cannot get the program to total all of the parts that i have selected becasue my variables will not carry over from the sub command for the command buttons when i press my total button. I am using vb6.0
CrashZero
11-03-2004, 09:45
Can we see your code??? Or is it a secret?
Greg Needel
11-03-2004, 12:46
are you compileing your variables before you try and sum them or is it an after affect
ie. function sample(x,y,z,p,d,q)
sum = x+Y+Z+P+D+Q
or
sum1 = x+y+z
sum2 = P+D+Q
Total = sum1 + sum2
i have found that doing inbetween steps like example 2 under each part of your program works better
Astronouth7303
11-03-2004, 14:12
I am just trying to click on commmand buttons that say Robot COntroller or Battery and they list the price in a picture box. I have all of that done but i cannot get the program to total all of the parts that i have selected becasue my variables will not carry over from the sub command for the command buttons when i press my total button. I am using vb6.0
PICTURE BOX?!?!?!?!? :ahh: Use a text box, first of all. The Text property is the equivelent of Value.
Are you using Quanity textboxes, too?
say:
cbRC_Add as CommandButton
cbBat_Add as CommandButton
tbRC_Quanity as Textbox
lblRC_Total as Label
lblRC_Price as Label
tbBat_Quanity as Textbox
lblBat_Total as Label
lblBat_Price as Label
tbTotal as Label
These are the controls on your form.
So:
const RC_Price as currency = 500 'Sub type of variant
const Bat_Price as currency = 100
dim RC_Quanity as long, RC_Total as Currency
dim Bat_Quanity as long, Bat_Total as currency
dim Total as currency
private sub Form_Load ()
RC_Quanity = 0
Bat_Quanity = 0
Update
end sub
Public sub Update()
RC_Total = RC_Price * RC_Quanity
Bat_Total = Bat_Price * Bat_Quanity
Total = RC_Total + Bat_Total
tbRC_Quanity = RC_Quanity
tbRC_Total = RC_Total
lblRC_Price = RC_Price
tbBat_Quanity = Bat_Quanity
tbBat_Total = Bat_Total
lblBat_Price = Bat_Price
tbTotal = Total
end sub
Be sure to insert Event hadlers for the command buttons and text boxes (Check for correct type).
CrashZero
11-03-2004, 15:08
I agree with Astronouth7303 200% what are you doing using a picture box!!!???!!?!!?!!? If you don't want people to be able to change the value then even using a label would be better then a picture box!
deltacoder1020
17-03-2004, 10:36
probably because he is using Print() so that he doesn't have to deal with linebreaks and the previous contents. however, i agree that a textbox is probably better here - the small amount of extra code is worth it.
i'd probably recommend a global variable to keep a running total in.
Astronouth7303
17-03-2004, 14:56
If you look at my code, I use variables for storing values and controls to display them. You could use the controls for storing values (VB handles conversions). But this introduces errors (possibly).
Astronouth7303
19-03-2004, 20:06
I just found something out about VB: it's predictable! :D lol
my brother (Bro) has been doing VC++ for a few months and has totally forgoten how to use VB, and I'm helping him make a control (Or: telling him he has to use "Not A" instead of "!A")
If you look at my code, I use variables for storing values and controls to display them. You could use the controls for storing values (VB handles conversions). But this introduces errors (possibly).Hardly any (hopefully none) professional programmers would do this. Not only do you introduce the possiblity of introducing errors, it is less clean and violates a lot of principles of programming, such as information hiding.
P.S. VB gives me shivers. ;) Go Java and C++. :)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.