If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Transaction Counter Ticketing System

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-11, 01:42
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
Transaction Counter Ticketing System

Hi am just trying to learn vb cause a friend advised me that this thing could be a big help to me. I have learned the basic but unfortunately, it would take me weeks or months perhaps to master this thing. Am a bit hesitant cause am a little bit shy but am taking my chances. I hope a kind hearted samaritan could help me with my problem. (=

We would like to have our own ticketing system wherein it would give a seperate continuous number for our Three counters. Like if a click a certain button asking them what to do, it would print,referring them to the counter and what number they are in the que. I know u guys understand. (=

Thats all. Thank u so much for ur time reading this concern.(=
Attached Thumbnails
Transaction Counter Ticketing System-untitled.jpg  
Reply With Quote
  #2 (permalink)  
Old 11-27-11, 17:33
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
So what part if giving you problems?

Is it the generation of the numbers?

Sounds like a homework question to be honest.
Reply With Quote
  #3 (permalink)  
Old 11-27-11, 20:50
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
hi rokslide, good day. Thank u for your reply. (=

its a bit off topic but just a little introduction about me, i learned simple programming here at dbforums with Sinddho and with his help i made a queing system through access and now were using it at the office. Am trying to update myself by reading, thats how i learned about vb.And through a friends advise, i tried doing it by reading articles here at the net.Guess vb is a bit complicated as i thought compared with ms access. (=

About my problem (ahhh, how can i explain this, hahahaha),you're right. its the giving of the number that is giving me a hard time. At first i thought i did it using this code, but its doing it a bit different with what i have in mind.

Dim startNumber As Integer
Dim endNumber As Integer
Dim i As Integer

startNumber = 1
endNumber = 4

For i = startNumber To endNumber
Msgbox i
Next i
Reply With Quote
  #4 (permalink)  
Old 11-27-11, 21:00
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
What you have will only work if you have less than 4 people getting tickets... what you really want is something like...

Code:
Dim iTicket as Integer
iTicket = 0

function getTicket()
  iTicket = iTicket + 1
  getTicket = iTicket;
end

buttonOnClick()
  MsgBox("You ticket is number " & getTicket())
end
So your buttonOnClick event is linked to the buttons on the screen. Your other code is declared in the form itself.

As you are serving 3 seperate counters your may want to show this in the ticket somehow such as prefixing the ticket number with a different code per counter.

If that is the case you would need multiple OnClick events
Reply With Quote
  #5 (permalink)  
Old 11-27-11, 21:14
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
wow thank u. that was fast i must say.

am trying it now rokslide. update you after. thank u so much.(=
Reply With Quote
  #6 (permalink)  
Old 11-27-11, 21:17
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
No problem. Bear in mind that I don't write VB any more and don't have a system to test any of this on so I can't attest to it being correct.
Reply With Quote
  #7 (permalink)  
Old 11-27-11, 21:37
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
ill have that in mind..(=

rokslide, i tried the code but i got these errors. but am still trying if i could fix it.
Attached Thumbnails
Transaction Counter Ticketing System-error.jpg  
Reply With Quote
  #8 (permalink)  
Old 11-27-11, 21:43
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
The problems that you have based on the image shown are that you have essentially put everything I have in to the button click event.

You only need the following between the Private Sub Button1_Click and End lines
Code:
 MsgBox("You ticket is number " & getTicket())
the other part
Code:
Dim iTicket as Integer
iTicket = 0

function getTicket()
  iTicket = iTicket + 1
  getTicket = iTicket
end
goes after the public class Form1 line and before the Private Sub TextBox1 line.

You may need to move the iTicket = 0 line into the form onload event as well.

Oh, I have also corrected some of the code, I tend to include semi colons at the end of lines as that is the standard for C#
Reply With Quote
  #9 (permalink)  
Old 11-27-11, 21:50
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
oh i see. my apology rokslide. ill try it again.(=
Reply With Quote
  #10 (permalink)  
Old 11-27-11, 21:52
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
i think iam having a nosebleed here..haha. this is fun i must say. (=
Reply With Quote
  #11 (permalink)  
Old 11-28-11, 17:20
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
How did you get on??
Reply With Quote
  #12 (permalink)  
Old 11-28-11, 18:12
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
rokslide, to tell u the truth, am about to give up. This may look so silly but i searched many site looking for the onload event but to no avail, i cant find it. Still i cant make it work..Sorry Rocslide.
Reply With Quote
  #13 (permalink)  
Old 11-28-11, 19:34
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
If you view the form in design mode and double click on the form canvas I think this will automatically create the form onload event for you.
Reply With Quote
  #14 (permalink)  
Old 11-28-11, 21:30
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
rocslide, i got the onload event thing. (=

iam just wondering everytime i run it, and click the first button. the window stops debugging and it automatically closes. dont know y.)=
Reply With Quote
  #15 (permalink)  
Old 11-28-11, 21:32
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
What have you got in the on click event for that button??
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On