Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 8th, 2005, 10:08 AM
dipesh dipesh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 dipesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
simple count

hey, i have been asked for my assigment to make a booking porgramme i have done the whole programme and all i need is to knowmake a simple count code where if the user clicks make booking then it adds one to the total bookings made. Each time the make booking is clickd it should add one to the counter and display it. Please help me as the followin code doesnt work

Private Sub Command1_Click()
win = 0
If bookingsmade.Enabled = True Then
win = win + 1
Label1.Caption = win
End If
End Sub

Reply With Quote
  #2  
Old January 8th, 2005, 04:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 33 m
Reputation Power: 181
I'd say use an autonumber or identity column in your database.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old January 8th, 2005, 06:12 PM
dipesh dipesh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 dipesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re:simple count

no u dnt understand im not using a database the booking to be printed out. so aftr each bookin is made it should add to a counter n when the programme closes it disays how many booking where made. (all on vb6)

Reply With Quote
  #4  
Old January 8th, 2005, 08:29 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 22 h 25 m 10 sec
Reputation Power: 1488
In your code, you are checking for bookingsmade.Enabled = True in order to add one to your counter. What kind of control is bookingsmade. I ask this because if all you want to do is increment the counter of bookings when a button is clicked, then write your code as follows.
Code:
 
  Private Sub Command1_Click()
   win = win + 1
   Label1.Caption = win
  End Sub

Also make sure that your win variable is global so that it can be accessed by Command1.

Reply With Quote
  #5  
Old January 8th, 2005, 09:16 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 33 m
Reputation Power: 181
But where are you storing these booking numbers, or do they just vanish when you close your program?

Reply With Quote
  #6  
Old January 9th, 2005, 08:14 AM
dipesh dipesh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 dipesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
simple count

i want to booking coming up in a msgbox when the programme is about it end. once a cmd button is clicked it adds one to the counter and when the programme is about to close it displays how many booking were made.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > simple count


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT