Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
john.knapp commented: looks like a two-fer on that answer +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try this instead

Imports System.Data
Imports System.Data.SqlClient

Public Class Form1

    Public connectionstring As String = "Server=.\SQLEXPRESS;Database=PUBS;Trusted_Connection=yes;"
    Public sqlDataset As New DataSet
    Public recnum As Integer

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

        Dim conn As New SqlConnection(connectionstring)
        Dim da As New SqlDataAdapter("SELECT * FROM Authors ", conn)

        conn.Open()
        da.Fill(sqlDataset, "Vb_table")
        conn.Close()

        recnum = 0
        nav()

    End Sub

    Private Sub nav()

        If recnum < sqlDataset.Tables("Vb_table").Rows.Count Then
            TextBox1.Text = sqlDataset.Tables("Vb_table").Rows(recnum).Item(1)
            TextBox2.Text = sqlDataset.Tables("Vb_table").Rows(recnum).Item(2)
            TextBox3.Text = sqlDataset.Tables("Vb_table").Rows(recnum).Item(3)
        Else
            MsgBox("end of table")
        End If

    End Sub

    Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click
        recnum += 1
        nav()
    End Sub

End Class
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Also, SUM doesn't add up the values inside the parentheses.

SELECT SUM(Physics) FROM tblClass1

Will give you the total of all the Physics marks for all students. It SUMS down the rows rather than across the columns.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Here is the thing: Users love the lipstick. They dont care if there is a pig behind it. Thats the developers problem.

And when it takes the developer five times as long to fix a problem because what's underneath is crap you complain because problems aren't being attended to. By the same token, as long as your car body looks great you don't care if the engine needs constant tinkering to keep it working. I'm glad the automotive engineers don't design to suit your tastes. I prefer quality work both inside and out. As a developer who also had to take over code written by others, I have had to say on several occasions that the requested changes were either impossible or prohibitively expensive and time consuming because the original code was so horribly written.

The base should be the best for DaniWeb's users.

I'm not seeing a lot of complaints, bug reports or suggestions for improvement so it looks to me like most users are either happy with the new system or not upset enough to give voice.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could also set the default value for any mark field to 0 so that NULLS are never encountered.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

quoting you is near imposible
this is going to be painful to quote and copy code

Then you should take the two minutes it takes to learn how to do it. Since the last changes (which were made following suggestions from the users) I no longer have a problem quoting either manually or with the Quote button.

backend of vBulletin was a mess and the frontend was good, but now this new system, the backend is nice but the frontend

From what I understand (I don't have to work with the code), trying to "pretty up" the frontend of VBulletin was like putting lipstick on a pig. IMO you start with a solid foundation then build on that. You don't spend your time playing whack-a-mole with a crappy code base.

but most importantly it doesnt get better

Actually, several of the problems I have reported have been quickly looked at and fixed. Even one which was apparently on my end (thank you Dani). Isn't that the definition of "better"?

what if I get logged out or I am not logged in,

I have never been spontaneously logged out. Has anyone ever reported this happening? As for posting when not logged in, I have already made a suggestion (rather than a complaint) about that.

And Ive read that Im the only one complaining

There are complaints ("this sucks") and there are bug reports. Bug reports are helpful and provide information …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What browser/OS are you using? I can once again repeat and confirm that it does NOT work in IE9/Windows 7.

Firefox 16 and IE9.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As far as I know, Access does not support temporary tables. However, you can create a table on the fly with SELECT INTO as in

SELECT * INTO temptable FROM Customers WHERE Address  LIKE '*C*'

Just remember to drop the table when you are done.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

CTRL-A followed by CTRL-C allows me to copy the entire post (the one I am currently entering) to the clipboard. On other posts, double clicking in a code snippet copies the entire snippet (including formatting) to the clipboard. Clicking and dragging selects a block of text, then CTRL-C copies it to the clipbooard. No functional problems there.

I typed up a long post and for some reason, Daniweb logged me out.

I imagine what happened is that you were never logged in. If I am not logged in and I click on a link in my email, I am taken to that post. I can start typing a response but I can't post it because I am not logged in. At that point I have to copy all of the text I have entered to the clipboard, log in, then paste that text back into the text area. As far as I am concerned, since you can't post unless you are logged in then you should not be able to enter text.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have no way of knowing where your code is being executed. Is any of the code inside the timer Tick event handlers? For what you are trying to do I would put the following code in the Timer2_Tick handler

counter += 1
Label1.Text = counter

If counter = 180 Then
    counter = 0
    Timer2.Enabled = false
    Timer3.Enabled = true
End If

then in Timer3_Click I would put

counter += 1
label2.Text = counter

If counter = 80 Then
    Timer3.Enabled = False
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You have another table which uses that primary key as a foreign key. If you delete that record then the other table will have an orphan (a record that doesn't point back anywhere). If you are using MS SQL you should be able to set up something called cascading referential integrity. This causes all dependent records in other tables to be automatically deleted when the primary record is deleted. I've never used it but you can read up on it here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The following query does the calculation and orders the results from top marks to lowest marks

SELECT StudentID, Physics+English+Chemistry+Biology+History AS totalMarks
  FROM tblClass1
 ORDER BY totalMarks DESC

To pick the top five you can use

SELECT TOP 5 StudentID, Physics+English+Chemistry+Biology+History AS totalMarks
  FROM tblClass1
 ORDER BY totalMarks DESC

but keep in mind that you may have more than five students with the top five marks.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Facts are stupid things.

Ah. You're a Republican then.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think I'll close this thread. It's getting off topic and silly.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm happy I don't have to worry about exams any more

I had a final in a third year numerical analysis course back in the mid 70s. I showed up on campus an hour at 1:00 for the 6:00 PM exam. On the way through the debug terminal (where plebes ran their card decks) I ran into the course Prof. I expressed surprise that he was "slumming". He expressed surprise that I wasn't in the exam room writing the final. My blood froze. At that point I panicked because at that particular moment I didn't know where the exam room was. I ran into three different exam sessions before I found the right room. Also, 30 minutes after the exam starts they won't let you in. Fortunately the exam had started at 1:30 and not 1:00 so I was only 25 minutes late. It took me 15 minutes to get my breath back.

It's only been in the last five years that I stopped having the occasional bad dream about that.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You haven't created the objects. The statement

Dim cn As OleDb.OleDbConnection

says "allocate a variable named cn that can be used to access an OleDbConnection object. That statement doesn't actually create the object (it isn't pointing at anything). You need to use

Dim cn As New OleDb.OleDbConnection

This creates the object AND stores the address of it in cn. You have to do this for every object that you want to use.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

perhaps the one-word solution is MU.

MU?

Don't have a cow, man. - Bart Simpson

Mike Askew commented: lul +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Based on the last few weeks, some people would have you believe that the one word solution is "Romney".

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I should have said "DNS name" rather than URL. It will convert www.daniweb to an IP address but not http://www.daniweb.com. I have played around with it off and on since I originally wrote it. It is possible I may have introduced a bug in the up/down times. I'll try to find some time to look at it tomorrow.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

To borrow a quote from the inimitable Dan Quayle, "that one word is 'to be prepared'". But anyone who thinks there is a one word answer clearly does not understand the problem.

faroukmuhammad commented: you are probably right... +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I found that cramming right up to the exam time just got me extra wound up. What worked for me was to stop preparing a few hours before the exam, show up to the exam site an hour early with a cup of coffee and fine some place close by to drink the coffee while perusing anything totally unrelated to the exam.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I wrote something similar while troubleshooting a wireless internet connection this summer. You are welcoome to have a look if it will help. You'll find it here. It uses three background threads to monitor

  • The wireless hub (192.168.1.1)
  • two DNS

although you can enter up to three IP addresses or URLs of your choice.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm not James :/

Sorry. I was going on 24 hours with almost no sleep. I meant Sanjay (I think).

Of all liars, the smoothest and most convincing is memory. - Anonymous

~s.o.s~ commented: Hah, no worries. Nice quote BTW. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Reason

That's the only way out of most messes. Rational thought.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Here is a sample of traversing a simple xml structure

    Dim myxml = <root>
                    <level id="1">
                        <prop n="PROPERTY" v="VALUE"/>
                    </level>
                    <level id="2">
                        <prop n="PROPERTY" v="VALUE"/>
                    </level>
                </root>

    For Each level In myxml.Elements
        Debug.WriteLine("id=" & level.@id.ToString)
        For Each prop In level.Elements
            Debug.WriteLine("n=" & prop.@n.ToString & "  v=" & prop.@v.ToString)
        Next
    Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I found this movie highly entertaining. It sounds like a porn movie but it isn't. It's called Snatch and stars Benedicio del Toro, Dennis Farina, Vinnie Jones and Brad Pitt.

Unscrupulous boxing promoters, violent bookmakers, a Russian gangster, incompetent amateur robbers, and supposedly Jewish jewelers fight to track down a priceless stolen diamond.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Just about anything but whale's milk and porpoise flippers.

Sahil89 commented: :D +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My older son is currently living in Stony Brook, Long Island. His house was on a hill (60 feet above sea level) and survived intact. However, he spent the duration of the storm in his office at the University (which also survived intact - 40 feet abouve sea level). He was lucky - the University has its own power system so the power remained on (except for the odd flicker) throughout. Here in Winnipeg we are pretty much isolated from any effects.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'd start by changing the code (for now) as follows

    Dim myProcess As Process = New Process()

    myProcess.StartInfo.FileName = "cmd.exe"
    myProcess.StartInfo.Arguments = "/K " & "rabcasm.exe " & "\Source\" & "3.3.0-1\3.3.0-1.main.asasm"

    myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
    myProcess.StartInfo.CreateNoWindow = False
    myProcess.Start()

    myProcess.WaitForExit(60000)
    If Not myProcess.HasExited Then
        myProcess.Kill()
    End If
    myProcess.Close()

Note the changes as follows

  • using /K instead of /C to keep the window open
  • using ProcessWindowStyle.Normal and CreateNoWindow = False
  • WaitForExit(60000)

Those changes will allow you to see what is happening. It is possible your process is getting hung up somewhere. Making the window visible and keeping it open will give you a chance to see if that is the case. Your WaitForProcess was only set to one second which means you were likely killing the process before it completed.

SaaDwTk commented: You are the best XD +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Public Sub writeFile(filePath As String, noLine As Integer, newText As String)
    Dim lines() As String = IO.File.ReadAllLines(filePath)
    lines(noLine) = newText
    IO.File.WriteAllLines(filepath,lines)
End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The easiest way is to use the IntersectsWith method of the Rectangle object.

    Private Sub Form1_KeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp

        Dim inc As Integer = 10
        Dim locn As Point

        Select Case e.KeyCode
            Case Keys.Up
                locn = New Point(Me.Location.X, Me.Location.Y - inc)
            Case Keys.Down
                locn = New Point(Me.Location.X, Me.Location.Y + inc)
            Case Keys.Left
                locn = New Point(Me.Location.X - inc, Me.Location.Y)
            Case Keys.Right
                locn = New Point(Me.Location.X + inc, Me.Location.Y)
        End Select

        If Not OverLaps(locn, Me.Size, Form2.Location, Form2.Size) Then
            Me.Location = locn
        End If

    End Sub

    Private Function OverLaps(f1locn As Point, f1size As Size, f2locn As Point, f2size As Size) As Boolean

        Dim rect1 As New Rectangle(f1locn, f1size)
        Dim rect2 As New Rectangle(f2locn, f2size)

        Return rect1.IntersectsWith(rect2)

    End Function
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Do you mean a form from the same application?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Set the form KeyPreview property to true then add the following handler

Private Sub Form1_KeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp

    Dim inc As Integer = 10

    Select Case e.KeyCode
        Case Keys.Up
            Me.Location = New Point(Me.Location.X, Me.Location.Y - inc)
        Case Keys.Down
            Me.Location = New Point(Me.Location.X, Me.Location.Y + inc)
        Case Keys.Left
            Me.Location = New Point(Me.Location.X - inc, Me.Location.Y)
        Case Keys.Right
            Me.Location = New Point(Me.Location.X + inc, Me.Location.Y)
    End Select

End Sub

Set inc to whatever increment is appropriate for youtr app.

timon.bijl commented: thx! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Look at my code

SQLstr = " SELECT SUM((KYUERR1 + VISION1 + KEIJYOU1) * UNITCOST) AS RM " &
         "   FROM VAC_JSINFO " &
         "  WHERE (COLLECTDATE > '" & fstrtTime & "') " &
         "    AND (COLLECTDATE < '" & fendTime & "') " &
         "    AND (KYUERR1 >= 0) " &
         "  ORDER BY RM DESC"

and look at your code

Dim SQLstr As String = " SELECT SUM((KYUERR1 + VISION1 + KEIJYOU1) * UNITCOST) AS RM "
SQLstr &= " FROM VAC_JSINFO "
SQLstr &= " WHERE (COLLECTDATE > '" & fstrtTime & "') AND (COLLECTDATE < '" & fendTime & "') AND (KYUERR1 >= 0) "
SQLstr &= " ORDER BY RM DESC "

see the difference? Try this

Public Function SumYC1() As String

    Dim SQLstr As String
    Dim fstrtTime As String
    Dim fendTime As String
    Dim res1 As String

    Dim DBConn As New SqlConnection("server=xxxx;uid=xxx;pwd=xxx;database=xxx")
    DBConn.Open()    

    Dim DBCmd As New SqlCommand
    DBCmd.Connection = DBConn

    Dim i As Integer = 0

    Do
        i -= 1
        fstrtTime = Date.Now.AddDays(i).ToString("yyyy/MM/dd") & " " & "06:15:00"
        fendTime  = Date.Now.AddDays(i).ToString("yyyy/MM/dd") & " " & "18:15:00"

        SQLstr = " SELECT SUM((KYUERR1 + VISION1 + KEIJYOU1) * UNITCOST) AS RM " &
                 "   FROM VAC_JSINFO " &
                 "  WHERE (COLLECTDATE > '" & fstrtTime & "') " &
                 "    AND (COLLECTDATE < '" & fendTime & "') " &
                 "    AND (KYUERR1 >= 0) " &
                 "  ORDER BY RM DESC"

        DBCmd.CommandText = SQLstr
        res1 = DBCmd.ExecuteScalar().ToString()

    Loop …
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Or more concisely

Dim folder As String = "D:\temp"

For Each file As String In My.Computer.FileSystem.GetFiles(folder, FileIO.SearchOption.SearchTopLevelOnly, "*.csv")
    Debug.WriteLine(file)
    'do work
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I freak whenever anyone touches my monitor screen. It was bad enough at the office with a glass screen. It's even worse with a laptop. I got so fed up with cleaning fingerprints off the display that my response now is (when the perp is wearing glasses) to remove their glasses and plant a great greasy fingerprint in the middle of each lens. It gets the point across. Occasionally when I get a "well that was rude" response I just reply "and what you did wasn't?".

So I have to wonder how bad things are going to get with the proliferation of touch screen technology. I understand there is a lot of research being done to create surfaces to which body oils will not cling but we're not there yet.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My nephew had this done a few years ago. It was his first one. After a few hours( and only halfway through) the artist asked him if he'd like to finish it up another day. His response was "once I get out of this chair there's no way I'm ever getting back in so you'd better finish today".
2009-07-18_18-04-24_0015_cr

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Does it really matter whether or not today is Monday? Just do the loop as

set start date to today

do
    subtract one from start day
    get the records for start day
loop while record count = 0

If today is (for example) Thursday then it will kick out after one iteration (Wednesday). If it is Monday then it will kick out when it finds a day with records which should be the previous working day.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I admit the problem had me bugged (ugh) but I am definitely gnat giving up (sorry).

Mike Askew commented: Luls +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Obviously all of your files aren't gone or your system wouldn't be running. How is your system partitioned? Where were the files that you can no longer find? Have you run the disk management console (diskmgmt.msc) to see what the disk info is? What version of Windows are you running? Have you tried a reboot?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We won't do your homework here either.

AndreRet commented: indeed :) +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It would make more sense (to me) to have the chapters in a combobox. Selecting a new chapter would automatically open the file. You said this was for school so I am assuming it is an assignment. We don't do other people's homework for them. However, we will give help with problems you may be having. For example, are you having trouble with

  1. the file input
  2. parsing the lines in the file
  3. storing the file contents in a data structure
  4. presenting the words to the user
  5. checking the user entry against the file

I asked about NL because my grandparents came to Canada from there in the 1890s.

rumanoid commented: thanks for helping +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Let me see if I have this.

  1. The user selects a file from a list
  2. The file contains pairs of words. The first is in one language, the second in another
  3. The program displays the first word and a textbox for the user to type the translation
  4. The program compares the translated word to the correct word that was in the file

Input file looks like

hond,dog
venster,window
huis,house

NL as in Netherlands?

rumanoid commented: Thanks for helping +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Been home from the cottage since the end of August. Remember that snowstorm a week ago? We were raking leaves in the middle of it. Should have waited (like I wanted to) for the nicer weather that eventually came back.

Stuugie commented: Another Up-Vote for your help. Thanks! +2
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Hey Stuggie, how are you enjoying this crappy fall weather?

Try replacing 'm' with just the word, month as in

select DATEPART(month,release_date) from etc
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I generally try to work from the simple case to the complex one. In this case your first concern is developing an algorithm to place the ships and you are complicating it with grids, labels, etc.

I'd start with a simple 10x10 integer array. Ships (at least in the classic game) cover either 2, 3, 4 or 5 cells ann can be placed horizontally or vertically. In VB, the indices of the rows and columns will run from 0 to 9 so that is the maximum range for the random numbers. You'll have to generate three numbers for each selection. One will be the row, the next the column, and the third will indicate direction. Once you generate the direction it will determine the upper range for either the row or column as ten minus the ship width. For example, if placing an aircraft carrier (5 cells) horizontally, the first column can't exceed 5 because that would overlap the right edge of the board.

Dim board(9,9) As Integer   'the playing area
Dim row As Integer          'row number from 0 to 9
Dim col As Integer          'column number from 0 to 9
Dim dir As Integer          'direction 0=horizontal, 1=vertical

So you start with a list of ship types and continue placing ships at random until the list is exhausted. That's your outer loop. In the inner loop you generate dir, then row and col (restricting the range based on dir). All you need then is a Sub that checks …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I took a look at the winners and compared the code to the code I had submitted. I was reminded of a very old Doonesbury cartoon.

BD: What are you writing your term paper on?

Mike: Juxtabranchial organ secretions in the higher order mollusks. You?

BD: Our friend the beaver.

Congratulations to all the winners. Amazing pieces of code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If

My.Computer.Audio.Play(My.Resources.alarm, AudioPlayMode.BackgroundLoop)
MsgBox(MessageBox.Text)
My.Computer.Audio.Stop()

works then

If cbxAudibleAlarm.Checked Then
    My.Computer.Audio.Play(My.Resources.alarm, AudioPlayMode.BackgroundLoop)
End If

MsgBox(MessageBox.Text)

If cbxAudibleAlarm.Checked Then
    My.Computer.Audio.Stop()
End If    

should also work

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's possible. For sample code please see this thread.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think what you are looking for is a Masked Text Box.