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

I have no idea what that first statement means.

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

Perhaps the problem is that nobody understands what you are intending. For example, a 3x10 matrix, by any definition I am familiar with, is a structure with 3 rows and 10 columns. I don't know what definition you are using. Also, because this is a database forum, it would be helpful to show the structure of the tables you are working with.

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

You don't need to do

mainForm.Form1_Load(Me, New EventArgs)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sure thing. See attached vb 2010 project. Note, the Hide and Show are optional. It depends on whether or not you want the main form to be visible. I included a Reset button so you could reset the flag back to True otherwise you'd only be able to test it once.

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

You can create a boolean settings variable with a name like FirstTime and set it to True. When your app starts, check the value of FirstTime. If it is true then hide the main form and display the settings form. Then set FirstTime to false and save it. If you give it User scope then the settings form will be displayed the first time for each user.

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

Could you please post the solution you found? It may be of help to other users. For future reference, if you have a comment aimed at a specific user it is best to identify the target in your post to avoid confusion. A typical way is to post

@someuser - this is my comment directed to someuser

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

There are various hotkey programs availible. I use Qliner Hotkeys. You can google for alternatives.

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

Glad to help. Feel free to post back if you have any specific questions.

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

Have a look at this tutorial for starters.

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

Please post the exact error message text. Also, check your connection string. You are using parentheses instead of curly brackets. Example

"Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase;   User=myUsername;Password=myPassword;Option=3;"
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It depends on where the database is and how heavily it is being used. If the database is on a server and it is heavily used by a large number of people/applications concurrently then best practice is to keep your connection closed until you need it. Then open it, use it, and close it again. The reason is that there are a limited number of connections available so you want to tie one up as little as possible. If your processing is in a loop and the loop will be executed without interruption then open the connection, process all records in the loop, then close it once the loop has ended.

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

I don't see why an endorsement is any less valid just because the endorsee has departed. I do, however, think endorsements from unverified members, or members with less than a particular level of rep or activity (to prevent bogus self-endorsement) should be excluded.

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

If you want to do this using a query you can execute

CREATE UNIQUE NONCLUSTERED INDEX IX_StudentNames 
    ON MyTable (StudentNames ASC)
  WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, 
        SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, 
        DROP_EXISTING = OFF, ONLINE = OFF, 
        ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) 
    ON [PRIMARY]
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Rather than trying to code up a convoluted query to do that you should instead restructure your table to have separate fields for given name(s) and surname. You run into problems when storing the names as "John Smith". For one thing, if you want to sort by last name you have to parse. Another thing is difficulty in parsing last names that consist of more than one word. For example, how do you handle "Jon van der Hoerst"? Structure the fields as

LastName
FirstName

and you can easily combine them in a query or create a view that combines the names.

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

No, he's stating that that's how Obama is trying to sell the ACA to his constituency

According to Santorum, by denying affordable health care to poor people they will get sick and die and not vote for the Democrats. So if I understand what he meant to say then he is basically claiming that both sides are trying to game the system to their advantage. The difference is, if it is gamed in favour of the Republicans, poor people die.

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

If you need the punctuation marks then you are better off doing as ddanbe says - char by char. Usually, puntuation marks are used as delimiters and are not considered as part of the data. In that case you get

Imports System.Text.RegularExpressions

Public Class Form1

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

        Dim rex As New Regex("[a-z|A-Z|0-9]")
        Dim str As String = "abc,123.xyz;praise;end,file,clear"
        Dim tok As String = ""

        For Each ch As Char In str.ToCharArray

            If rex.IsMatch(ch) Then
                'letter or digit - add it to the token string
                tok &= ch
            Else
                'punctuation - display two tokens and clear string
                Debug.WriteLine(tok)
                Debug.WriteLine(ch)
                tok = ""
            End If

        Next

        If tok.Length > 0 Then Debug.WriteLine(tok)

    End Sub

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

You could use regular expressions as follows

Imports System.Text.RegularExpressions

Public Class Form1

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

        'the pattern matches the longest string of letters and/or digits

        Dim rex As New Regex("[a-z|A-Z|0-9]+")
        Dim str As String = "abc,123.xyz;praise;end,file,clear"

        For Each m As Match In rex.Matches(str)
            Debug.WriteLine(": " & m.Value)
        Next

    End Sub

End Class
ddanbe commented: Indeed an option if you know regex well! Perhaps I should start learning. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Most people don’t get sick, and so free health care is just that, free health care, until you get sick. Then, if you get sick and you don’t get health care, you die and you don’t vote. It’s actually a pretty clever system. Take care of the people who can vote and people who can’t vote, get rid of them as quickly as possible by not giving them care so they can’t vote against you. That’s how it works.”

Rick Santorum speaking at a Young Americans for Freedom event Friday at the Reagan Ranch. The video for this amazing clip can be seen here

So according to Rick, Obama is giving everyone free health care (it isn't free) because if he doesn't, poor people will get sick and die and not be able to vote against him.

Outstanding!

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

or I may feel the need to issue another apology.

That's OK. If it comes to that I can take this one just by quoting the source. It seemed to work in the other thread.

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

Aren't the undergarments seen as a source of protection from the evils of the world? Sounds like magic underpants to me. And I believe the Mormon Church teaches that native Americans are descended from the Lamanites so by extension that makes all native Americans wicked.

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

Check them out to learn more

More than magic underpants and non-whites being descended from the evil side of the family tree? What more do I need to know?

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

Matthew and Luke both state that Jesus was born during the reign of Herod the Great who is believed to have died in 4 BCE.

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

AD takes pot shots at atheists and I take pot shots at Republicans. It's just what we do :-) Please note that nowhere does AD say we are stupid for doing so. He asks a valid question (however, one with an obvious answer).

And sometimes it is not just pot shots. We got into a very lengthy discussion about religion here some time back.

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

Fill the bars with Christmas drinking
fa la la la la la la la la
See the people getting stinking
fa la la la la la la la la
Though their brains are half corroded
fa la la la la la la la la
Still they try to drive home loaded
fa la la la la la la la la

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

Yes, it's a great story, but unfortunately it misleads people into believing that writing good code is a skill that can be picked up on the fly. Knowing how to nail two pieces of wood together does not mean you are capable of designing and building a house that won't collapse under its own weight. Any complex piece of code requires knowledge of proper design techniques.

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

I liked working on holidays. With almost everyone else gone the office was quiet with no interruptions.

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

Xmas as an alternative to Christmas actually dates back several hundred years. The X comes from the Greek letter, chi, which is the first letter of the word that we know in English as Christ.

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

It makes you wonder why so many people who claim to believe in God/Jesus are so afraid of dying when they also supposedly believe that their death would bring an end to suffering and the beginning of eternal bliss. By the way, Mike, you might find this amusing.

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

He said that the table contains only one column so

str = "INSERT INTO table1 (name) VALUES('" & TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text & "');"

would not work because you have to have the same number of values as you have fields in "(name)".

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

I can't imagine why it is complaining about a missing semi-colon, especially since it isn't necessary to have one in a single line statement. Try omitting it completely. As a tip, try formatting the statement as

str = "INSERT INTO table1 (name)" &
      " VALUES('" & TextBox1.Text & "')," &
             "('" & TextBox2.Text & "')," &
             "('" & TextBox3.Text & "')"

I find that it makes it easier to read and debug. And for even better (safer and cleaner) code you should use Parameterized Queries.

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

A typical statement to insert multiple rows at a time looks like

INSERT INTO table (fldname1, fldname2, fldname3)
       VALUES(val1, val2, val3),
             (val4, val5, val6),
             (val7, val8, val9)

Just modify for your particular database columns.

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

I aim to please but I believe I answered every question put to me. There is no question in this thread having anything to do with an inbuilt Visual data manager. That question was in this thread. In that thread I said I was unaware of the visual data manager capabilities of vb.net but I suggested what I thought was an alternative option (and a far better one than relying on anything which may be bundled with Visual Studio). Anyone else browsing that thread with advice to the contrary was free to hop in. Since I was the only one who responded then my advice was all you got. Without that you would have none.

As for the date format, when asked, I explained what I meant by System Date Format and I attempted to get more information on your column definition in order to provide a more accurate answer.

Having said that, I will take your comments into consideration. I appreciate you taking the time to voice them.

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

I wouldn't care if they were giving stuff away. There's nothing that would get me to participate in that insanity.

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

The only thing that could make it worse was if a lot of people had guns.

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

For Access you need

Dim qry As String = "SELECT * FROM Tran WHERE [Date]=#" & Date & "#"

Is your [Date] column actually declared as a date or is is declared as String (or char or varchar)?

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

Let's keep in mind that while there are genuine "experts" here on daniweb, there are also a lot of regular folk like me who are competent, but far from experts. I may not know more things than the person posting a question, just different things, so I may be answering a question one day and asking one the next. I also have the benefit of many years of experience which have taught me that there are many cases where the slick or clever solution is not the desirable (ie maintainable) solution.

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

I haven't been to a fast food place in years. I think the final straw was when McDonalds started selling its McCrap (or was that McWrap). It finally woke me up. Then I started noticing new slogans popping up

Arby's - "I'm so hungry I could eat at Arby's"

Taco Bell - "Technically, it's food"

Very rarely we will order in Chinese. We used to eat out a few times a year but our two favourite restaurants are no longer. Shabusen (Oriental stir fry) got new owners and went downhill and Arjuna's (Indonesian) closed. Arjuna's had the most incredible rice table.

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

I think it's inevitable that if we reach a certain tech level that we stop our evolution

I think the first 8 minutes or so of the (really bad) movie, Idiocracy, speaks volumes although that's cultural evolution at work as well as genetic.

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

You have to delimit the date. In SQL you use single quotes and in Access you use hash marks. If you want to use the current date in a query you can always use a builtin date function. In SQL this is

SELECT * FROM Tran WHERE [Date] = GETDATE()

Note the use of square brackets in the field name because Date is a reserved word.

Also, when I use the term system date format I am referring to the format that you see when you display the date column in an explorer window set to details view. If a file/folder date is shown as 2013-11-23 then your system date format is YYYY-MM-DD.

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

Some of you may recall (possibly) the worst ever eipsode of the original Star Trek. It was titled The Omega Glory. It involved a starship captain who was determined to discover the secret to the longevity of the natives of the planet he was on. The secret to their longevity was that they had evolved to live that long.

If you look at any species from a strictly evolutionary point of view, it makes little sense for an organism to live past the progeny producing/rearing years.

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

"Give a man a program, frustrate him for a day.Teach a man to program, frustrate him for a lifetime." - anonymous

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

It depends on your database. Assuming your system date format is set to "dd-mm-yyyy" then for a SQL database you would use single quotes around the field just like in 'CASH', however for Access you would use hash marks as in #20-11-2013#

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
"select * from Tran where Acno=" & TxtAcno.Text & " and name='CASH'"
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I reformatted your code. The Code button works better in conjunction with proper indentation.

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

Try

rec("name").Value
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you properly indent your code then it looks like

Private Sub cmdBuild_Click()

    Dim Message As String
    Dim I As Integer

    Message = PizzaWhere + vbCr
    Message = Message + PizzaSize + " Pizza" + vbCr
    Message = Message + PizzaCrust + vbCr

    For I = 0 To 5
        If chkTop(I).Value = vbChecked Then
            Message = Message + chkTop(I).Caption + vbCr
        Else 
            If chkTop(I).Value = vbUnchecked Then 
                Message = Message + "Cheese Only" + vbCr
    Next I

    MsgBox Message, vbOKOnly, "Your Pizza"

    End If
    End If

End Sub

Once you do that the problem becomes a little more obvious. That was my best guess as to the formatting. If I just copy your code into the IDE I get

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim Message As String
        Dim I As Integer
        Message = PizzaWhere + vbCr
        Message = Message + PizzaSize + " Pizza" + vbCr
        Message = Message + PizzaCrust + vbCr
        For I = 0 To 5
            If chkTop(I).Value = vbChecked Then Message = Message _
            + chkTop(I).Caption + vbCr
Else
            If chkTop(I).Value = vbUnchecked Then Message = Message _
            + "Cheese Only" + vbCr
        Next I
        MsgBox(Message, vbOKOnly, "Your Pizza")
End If
End If
    End Sub

Perhaps if you explain a little more clearly I can suggest something.

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

There was no way to know insurance companies were going to cancel policies if they were forced to do so because those policies were not in line with the ACA diktats

Policies that were in effect when the ACA was enacted were grandfathered in. At that point the insurance companies were informed as to what would be required for any new policies. Knowing this, the insurance companies created new policies, after the passing of the ACA, with the full knowledge that these policies would be invalid once the ACA came into effect.

If you're providing coverage beyond what ACA allows, at a price above what ACA allows, and now you're told by the ACA that you have to lower the price but aren't allowed to reduce the coverage, you as a company have but one option: cancel the policy.

The ACA does not force insurance companies to lower their prices. What it DOES do is provide a way for people to get the same or better coverage at a cheaper price. And what, exactly, do you mean by coverage beyond what ACA allows? The ACA certainly does not tell any company that their policies provide too much coverage.

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

Peaches. And the best one I ever ate was in the Okanogan Valley at the very end of the season when I ate one off the tree. I've never had one since that comes close to being as sweet or as juicy.

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

All the inspectors have to do is watch them make it and test the ingredients.

Unfortunately, the government is moving more and more toward allowing the industry to inspect and police itself. Even though the legislation providing for government inspectors is still in place, massive defunding has made it all but impossible to follow their mandate. So what it boils down to is the beef industry saying "trust us". And we've seen in California, and now in Washington, what happens when the people start demanding the labeling of food.