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
  #16 (permalink)  
Old 11-28-11, 21:47
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
are u asking for this one rocslide?


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


MsgBox("You ticket is number " & getTicket())


End Sub
Reply With Quote
  #17 (permalink)  
Old 11-28-11, 21:55
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Yep, that was the bit.... that is weird, there is nothing there that should exit the application.

Do you want to share the rest of the code you have?

Does it show the message box at all?
Reply With Quote
  #18 (permalink)  
Old 11-28-11, 22:03
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
the message box does not pop out rocslide. )=

am afraid i have no more code to share cause the only code ive been using is the one you gave me. I really have no idea what more to add on it. But this is whats on it.

Public Class Form1
Dim iTicket As Integer


Function getTicket()
iTicket = iTicket + 1
getTicket = iTicket
End

End Function


Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

buttonOnClick()
MsgBox("You ticket is number " & getTicket())


End Sub

Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

iTicket = 0
End Sub

Private Sub buttonOnClick()
MsgBox("You ticket is number " & getTicket())
Reply With Quote
  #19 (permalink)  
Old 11-28-11, 22:06
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
no problems change this...
Code:
Function getTicket()
    iTicket = iTicket + 1
    getTicket = iTicket
    End

End Function
to this
Code:
Function getTicket()
    iTicket = iTicket + 1
    getTicket = iTicket
End Function
The End before the end function is ending the execution of the application.
Reply With Quote
  #20 (permalink)  
Old 11-28-11, 22:25
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
rokslide, cool! it worked! haha.

But the problem is, its giving me two numbers at the same time. I mean, when i clicked the first button, a message box appeared and said that my ticket number is number 1. When i clicked ok, it gave me another msgbox saying that my number is number 2. What am thinking is that the second msgbox will ask me if i would like to print the first number it gave me?

Sorry rokslide for asking to much of your time and knowledge..I am very thankful of your help. (=
Reply With Quote
  #21 (permalink)  
Old 11-28-11, 22:36
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie, have a look at the code you have.

You have an event handler for the button click event called Private Sub Button1_Click

So when the use clicks on the button this code fires.

In this code the first line that executes is buttonOnClick() when is another private sub routine you have declared further down in your code.

If you look at that sub routine it appears to do the same as your event handler.

This is why you are getting the same message twice.

Do you need help to sort out the second message box now that I have explained what is happening?
Reply With Quote
  #22 (permalink)  
Old 11-28-11, 23:49
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
rokslide thank u for that information. Really it made me smile finally understanding whats going on out there. I changed the second message box to "Would you like to print the number?" and it worked.

Would it be to much if i ask again how can i print the number? (=. Thank you so much.
Reply With Quote
  #23 (permalink)  
Old 11-29-11, 16:01
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
To be honest I don't know, it has been ages since I worked with VB and when I did printing from it we normally used a reporting tool such as crystal reports.

You should be able to find a tutorial on it though via a google search
Reply With Quote
  #24 (permalink)  
Old 11-30-11, 18:18
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
hi rokslide.

Just as i thought, printing this one requires a crystal report. Ive been googling this one for some time now and i asked someone (we just met through a friend but unfortunately we never met again) if i really need this thing in configuring the db for me to be able to print the info. Am just wondering how he do it cause he said

"No. .NET has its own printing subsystem that uses GDI+ for Windows Forms."

anyway, thank u so much rocslide. Update you if ever i find success in building this project. Thank u soooo much for your help.(=
Reply With Quote
  #25 (permalink)  
Old 11-30-11, 18:50
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
No crystal is not required, as stated in my previous reply, it is simply what I have used in the past.

This tutorial should guide you through what you need though...

An absolute beginner's guide to printing in .NET - CodeProject
Reply With Quote
  #26 (permalink)  
Old 12-01-11, 02:57
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
clicked.(=

Thank you rocslide for the link.(=
Reply With Quote
  #27 (permalink)  
Old 12-01-11, 21:08
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
omg, i think am having a nosebleed..
Reply With Quote
  #28 (permalink)  
Old 12-13-11, 23:33
dennis_ian dennis_ian is offline
Registered User
 
Join Date: Oct 2011
Posts: 45
hello rocslide, its been a while.just wanna give you an update.

I was able to make my system prints the number and it was really a treat..(=

can i add one more last question...just one more and i guess am off..(=


is it possible to add some text like

"Please proceed to counter 17. You are number ___".

thank u so much.
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