Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Join Date
    Oct 2011
    Posts
    45

    Unanswered: 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 Attached Thumbnails untitled.JPG  

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    So what part if giving you problems?

    Is it the generation of the numbers?

    Sounds like a homework question to be honest.

  3. #3
    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

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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

  5. #5
    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.(=

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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.

  7. #7
    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 Attached Thumbnails error.JPG  

  8. #8
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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#

  9. #9
    Join Date
    Oct 2011
    Posts
    45
    oh i see. my apology rokslide. ill try it again.(=

  10. #10
    Join Date
    Oct 2011
    Posts
    45
    i think iam having a nosebleed here..haha. this is fun i must say. (=

  11. #11
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    How did you get on??

  12. #12
    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.

  13. #13
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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.

  14. #14
    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.)=

  15. #15
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    What have you got in the on click event for that button??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •