Oxiegen 88 Basically an Occasional Poster Featured Poster

It doesn't really matter which database source that you use (SQL Server (any edition), Access, Excel, Oracle and so on).
As long as you can get the relevant data into a DataTable, then all you have to do is use that as the DataSource for the crystal report.

Oxiegen 88 Basically an Occasional Poster Featured Poster

x = system.io.path.getfilename(track) will only give you the filename.

If you want to display only the filename, but still have access to the full path, then I suggest that you add a second, hidden, ListBox where you store the full path and filename.
And every time that you add another track to the playlist, then at the same time add the full path to the second ListBox using the "track" string.

So, when you click the song in the playlist, the song gets played from the second ListBox.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Glad to be of help. :)
Please mark this thread as solved if your question has been answered to you satisfaction.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Sure, in that case you can use the standard windows scheduler.
How To Schedule Tasks in Windows XP

Oxiegen 88 Basically an Occasional Poster Featured Poster

In the form load event, see if adding these three lines helps:

Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
Oxiegen 88 Basically an Occasional Poster Featured Poster

There is no way to schedule a webservice.
But you can easily create a reference to a webservice, and it makes no difference how it was created.
In Visual Studio in the Solution Explorer, right click on the project and select Add Service Reference. Click on the button Advanced at the bottom and then click Add Web Reference.
In this window you simply type in the URL to the webservice and click Go, type in a Web reference name and click Add Reference.

If you have a VB.NET windows app, then you can reference practically any webservice created in either ASP.NET, PHP or whatever.
It's up to you to handle the returns from the service.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I think Access is a bit more picky and needs to be told explicitly what kind of JOIN you are performing.
I suggest that you use either INNER JOIN or OUTER JOIN instead of just JOIN.
For more detail I also suggest that you read up a bit about using JOINs in Access.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can change the original cmd.CommandText text so that you incorporate both the insert and the select query using the EXISTS condition.
Like so:

cmd.CommandText = "INSERT INTO tbl_curriculum (course_code,subj_code) VALUES ('" & txtCode.Text & "','" & txtScode.Text & "') WHERE NOT EXISTS (SELECT subj_code FROM tbl_curriculum WHERE subj_code = '" & txtScode.Text & "')"

This will both save you some coding and also get rid of that IF statement.

debasisdas commented: effective solution. +9
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok.
You can expand this part of the code to include the marked code I provided:

'Gather a list of items in folder, then remove file path, then display items
Dim FilesInDir As String() = Directory.GetFiles(".\Folder", "*.txt", SearchOption.AllDirectories)
Dim SFile As String

ListView1.Items.Clear()
For Each SFile In FilesInDir
	ListView1.Items.Add(New ListViewItem(New String() {SFile.Replace(".\Folder\", ""), CStr(FileLen(SFile))}))

	'' --------- Add This Code ----------
	Dim stream As New FileStream(".\Folder\" & SFile, FileMode.Open, FileAccess.Read)
	Dim reader As New StreamReader(stream)
	Dim line As String = reader.ReadLine 'This is just to skip the first line in the file

	'Change the number 5 value to match the number of lines to read from the file
	'If only one line is to be read, then remove the For...Next statement but keep what's in it.
	For i As Integer = 1 To 5
		'First check to see if the end of the file is reached
		If Not reader.EndOfStream Then
			'Read the next line from the file
			line = reader.ReadLine
			'Add the line to the SubItems collection of the last added item in the ListView
			ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(line)
		End If
	Next

	reader.Close()
	'' --------- End of Added Code ----------
Next
Smalls commented: Was very Helpful. tweaked it a lil to fit my needs. thank again +3
Oxiegen 88 Basically an Occasional Poster Featured Poster

Anything is possible.

How are you populating the ListView in the first place?
Can't you also add the information for column 1 and 2 during the population phase?

If the folder is already known, then you can use the information in column 0 and call a function the performs the file reading and retrieving, while you are still populating the ListView.

No timer is needed.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps you could check to see if WinZip support command line arguments.
If that is the case, then you can probably perform a standard extraction to a folder you choose.
Then you can use Process.Start() to run that EXE file.

If that is NOT the case, then you can check out this Add-On for WinZip, which enables it to support command lines.
http://www.winzip.com/prodpagecl.htm

Oxiegen 88 Basically an Occasional Poster Featured Poster

All you need to do is to reformat the query into an UPDATE query.
Like so:

Dim cmd As New OleDbCommand("UPDATE tblPurchase_Order SET " _
"[Supplier_Id] = @Supplier_Id, [Address] = @Address, [Project_Id] = @Project_Id, " _
"[dtpDate] = @dtpDate, [Material_Id] = @Material_Id, [Material_Name] = @Material_Name, _
"[Unit] = @Unit, [Quantity] = @Quantity, [Unit_Price] = @Unit_Price, " _
"[Amount] = @Amount WHERE [Order_Id] = @Order_Id")

cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@Order_Id", lstItems.Items(i).SubItems(0).Text)
cmd.Parameters.AddWithValue("@Supplier_Id", lstItems.Items(i).SubItems(1).Text)
cmd.Parameters.AddWithValue("@Address", lstItems.Items(i).SubItems(2).Text)
cmd.Parameters.AddWithValue("@Project_Id", lstItems.Items(i).SubItems(3).Text)
cmd.Parameters.AddWithValue("@dtpDate", lstItems.Items(i).SubItems(4).Text)
cmd.Parameters.AddWithValue("@Material_Id", lstItems.Items(i).SubItems(5).Text)
cmd.Parameters.AddWithValue("@Material_Name", lstItems.Items(i).SubItems(6).Text)
cmd.Parameters.AddWithValue("@Unit", lstItems.Items(i).SubItems(7).Text)
cmd.Parameters.AddWithValue("@Quantity", lstItems.Items(i).SubItems(8).Text)
cmd.Parameters.AddWithValue("@Unit_Price", lstItems.Items(i).SubItems(9).Text)
cmd.Parameters.AddWithValue("@Amount", lstItems.Items(i).SubItems(10).Text)
Oxiegen 88 Basically an Occasional Poster Featured Poster

I have now tested this code, and it works flawlessly.
And as a side-note. That Select..Case statement you've got going.
No matter what agency you choose, data(1) to data(5) will contain the exact same thing.
The only reason to use such a statement, is if you change the order or if one of the data(1) to data(5) will contain something else.
This is clearly not the case.

Public Sub GetFileContents()
	Try
		Dim aStr() As String = New String() {}
		Dim FILE_NAME As String = "C:\Program Files\Autopay Terminal\BillPaymentRecords.txt"

		If System.IO.File.Exists(FILE_NAME) = True Then
			Dim objReader As New System.IO.StreamReader(FILE_NAME)
			Do While objReader.Peek() <> -1
				aStr = Split(objReader.ReadLine(), ";")
				SESSION_AGENCY_NAME = aStr(0)
				SESSION_AGENCY_ACCNO = aStr(1)
				SESSION_AGENCY_BILLNO = aStr(2)
				SESSION_AGENCY_BILLAMO = aStr(5)
				SESSION_AGENCY_BILLINT = aStr(4)

				If aStr(5).Trim <> "" Then
					dTotal += CDbl(aStr(5).Trim)
				End If
				If aStr(4).Trim <> "" Then
					ServiceC += CInt(aStr(4).Trim)
				End If

				nTotlistrec = ListView1.Items.Count
				If nTotlistrec < 10 Then
					addListView(aStr(0), aStr(1), aStr(2), aStr(3), aStr(4), aStr(5))
				End If
			Loop
		End If
	Catch ex As Exception
		WriteToLogFile("GetFileContents() -> " & ex.Message)
	End Try
End Sub
Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
	pnlDelete.BackgroundImage = My.Resources.BtnUp

	Try
		pnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
		ListView1.SelectedItems(0).Remove()

		If File.Exists("C:\Program Files\Autopay Terminal\BillPaymentRecords.txt") Then
			File.Delete("C:\Program Files\Autopay Terminal\BillPaymentRecords.txt")
		End If

		Dim writer As New StreamWriter(Application.StartupPath & "\BillPaymentRecords.txt", True)
		For Each item As ListViewItem In ListView1.Items
			Dim line As String = item.SubItems(0).Text & ";" _
			& item.SubItems(1).Text & ";" & item.SubItems(2).Text & ";" _
			& item.SubItems(3).Text & ";" & item.SubItems(4).Text & ";" …
Oxiegen 88 Basically an Occasional Poster Featured Poster

So you decided to do this instead?
No wonder it's doesn't work and that the textfile is empty.

If what I gave you works, then use it.
In the method GetFileContents you already have the code in place to calculate the total.

There is no need to actually store the totals, just let the program calculate it.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok, I'm just assuming based on original question that the listview only contains 5 columns.
So, let's try this:

Public Sub GetFileContents()
   Try
      Dim aStr() As String = New String() {}
      Dim FILE_NAME As String = "C:\Program Files\Autopay Terminal\BillPaymentRecords.txt"

      If System.IO.File.Exists(FILE_NAME) = True Then
         Dim objReader As New System.IO.StreamReader(FILE_NAME)
         Do While objReader.Peek() <> -1
            aStr = Split(objReader.ReadLine(), ";")
            SESSION_AGENCY_NAME = aStr(0)
            SESSION_AGENCY_ACCNO = aStr(1)
            SESSION_AGENCY_BILLNO = aStr(2)
            SESSION_AGENCY_BILLAMO = aStr(3) 'Change from 5 to 3
            SESSION_AGENCY_BILLINT = aStr(4)

            If aStr(3).Trim <> "" Then
               dTotal += CDbl(aStr(3).Trim) '.Replace("RM", "")
            End If
            If aStr(4).Trim <> "" Then
               ServiceC += CInt(aStr(4).Trim) 'Replace("RM", "")
            End If

            nTotlistrec = ListView1.Items.Count
            If nTotlistrec < 10 Then
               addListView(aStr(0), aStr(1), aStr(2), aStr(3), aStr(4))
            End If
         Loop
      End If
   Catch ex As Exception
      WriteToLogFile("GetFileContents() -> " & ex.Message)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Well.
I don't know how the code for GetFileContents() looks like, so it's impossible for my to determine why it doesn't work.
Perhaps you should take a look and determine when and how the variables dTotal and ServiceC are assigned.

Oxiegen 88 Basically an Occasional Poster Featured Poster

How about we shorten this code a bit...

Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
        PnlDelete.BackgroundImage = My.Resources.BtnUp

   Try
      PnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
      ListView1.SelectedItems(0).Remove()

      If File.Exists("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt") Then
         File.Delete("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt")
      End If

      Dim writer As New StreamWriter("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt", True)
      For Each item As ListViewItem In ListView1.Items
         Dim line As String = item.SubItems(0).Text & ";" _
         & item.SubItems(1).Text & ";" & item.SubItems(2).Text & ";" _
         & item.SubItems(3).Text & ";" & item.SubItems(4).Text
         writer.WriteLine(line)
      Next
      writer.Flush()
      writer.Close()

      GetFileContents()

      lblBillAmountValue.Text = Format(dTotal, "#,###,##0.00")
      lblServiceCharge.Text = Format(ServiceC, "#,###,##0.00")
   Catch ex As Exception
      MsgBox(ex.Message)
   End Try
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps if you check the number of items in the listview?

If ListView1.Items.Count = 0 Then
   paymentBtn.Enabled = False
Else
   paymentBtn.Enabled = True
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

Here is one way of performing that action.

Private Sub lvList_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles lvList.DoubleClick
   If lvList.SelectedItems.Count > 0 Then
      Dim title As String = lvList.SelectedItems(0).SubItems(1).Text

      'Create a new form with a custom constructor taking the title as argument.
      'Then perform any database lookups in that form based on the title.
      Dim frm As New PopUpForm(title)
      frm.ShowDialog
      frm.Dispose()
   End If
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

The simplest way, I guess, would be to use Server Explorer in Visual Studio.
There you will see, if any, the database server and it's name.
You will find it in the View menu.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yeah, I can see the problem.
Try this:

Private Sub buttonDelete(ByVal sender As Object, ByVal e As EventArgs) Handles buttonDelete.Click
   'Exit sub if no items are selected.
   If ListView1.SelectedItems.Count <= 0 Then Exit Sub
   Try
      'Remove the selected item from the listview
      ListView1.SelectedItems(0).Remove()

      'Delete the file, and recreate it based on remaining items in the listview
      Dim myFile As String = "C:\test.txt"
      Dim stream As New IO.FileStream(myFile, IO.FileMode.Create)
      Dim writer As New IO.StreamWriter(stream)

      writer.WriteLine("First name,lastname,address")

      For Each item As ListViewItem In ListView1.Items
         writer.WriteLine(item.SubItems(0).Text & "," & item.SubItems(1).Text & "," & item.SubItems(2).Text)
      Next
      writer.Flush()
      writer.Close()
      stream.Close()

      MessageBox.Show("Record has been permanently removed","Record Purge", MessageBoxButtons.OK, MessageBoxIcon.Information)
   Catch ex As Exception
      MessageBox.Show(ex.ToString(), "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you put that code in the same method that removes the selected item from the listview, then yes, it will be deleted from the file as well.

Oxiegen 88 Basically an Occasional Poster Featured Poster

The error message "login failed" suggests the a connection is created but that either
a) you not using windows authentication but the connection string is set for a proper login,
b) you're not using windows authentication and the username and/or password is wrong.
c) you are using windows authentication but the connection string is wrong (Connectionstrings) or

You should look into those scenarios.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm assuming that this text file is to be used as permanent record storage for when you are not running your program.
If that is the case, then I would strongly suggest that you reformat the text file into a CSV format (which also can be imported into Excel).

First name,lastname,adress
rae,alanah,new york
john,smith,los angeles

Here's my solution on how to do this:

Dim myFile As String = "C:\test.txt"
Dim stream As New IO.FileStream(myFile, IO.FileMode.Create)
Dim writer As New IO.StreamWriter(stream)

writer.WriteLine("First name,lastname,address")

For Each item As ListViewItem In ListView1.Items
   writer.WriteLine(item.SubItems(0).Text & "," & item.SubItems(1).Text & ","
 & item.SubItems(2).Text)
Next
writer.Flush()
writer.Close()
stream.Close()

This will effectivaly write to the file only the records you have in the listview. And if the file already exists, it will be overwritten.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes, you can use the startup forms Form_Load event.
If you call upon a second form to display as a dialog, then the execution of the Form_Load will "halt" until you close that second form.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
   Dim players As New Form2
   players.ShowDialog() '<- Execution will halt here until you close Form2
   players.Dispose()
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You need to iterate through all the rows in the listview, and compare the content of the cells in the first column with the content in the textbox.
Like so:

For Each item As ListViewItem In listview1.Items
   If item.SubItems(0).Text = textbox1.Text Then
      MessageBox.Show("That name is already in the list.", "Existing name", MessageBoxButtons.OK, MessageBoxIcon.Stop)
      Exit Sub
   End If
Next
Oxiegen 88 Basically an Occasional Poster Featured Poster

Great minds think alike. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

I don't know how they can be magically converted to binary on their own.
If you create and save a file in Random mode, then they should be read in Random mode. Also, if you create and save in Binary mode, then you should read them in Binary mode.

However, perhaps the error is occuring because of Records = LOF(FF) | Len(TOPFILE).
Consider the fact that the length of some objects has a zero-based index.
So, the line could be rewritten as: Records = (LOF(FF) | Len(TOPFILE)) - 1

Oxiegen 88 Basically an Occasional Poster Featured Poster

What the code does is this.
First it reads the entire file, line by line.
And while it reads, each line is compared to the semi-colon separated string of the record from the ListView.
And if the string does NOT match the record, it's inserted into the ArrayList.

Once finished, the file is deleted, and recreated using the strings in the ArrayList, except for the deleted record.

Which reminds me, do this replacement:

'Replace this line
Dim writer As New StreamWriter("", True)

'With this line
Dim writer As New StreamWriter("C:\Documents and Settings\Desktop\BillPaymentRecords.txt", True)
Oxiegen 88 Basically an Occasional Poster Featured Poster
combProductName2.SelecedIndex = combProductName2.FindExact(tbProductName.text)
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ah yes! I'm so very sorry. I missed that one.
On the 4 lines below "Dim stringToFind......", add an ampersand (&) in the beginning, separating the ampersand and "Listview1.SelectedItems(0)..." with a blank space.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yeah. Replace the line
Dim stringToFind As String = ListView1.SelectedItems(0).Text
with this:
Dim stringToFind As String = ListView1.SelectedItems(0).SubItems(0).Text & ";" _
ListView1.SelectedItems(0).SubItems(1).Text & ";" _
ListView1.SelectedItems(0).SubItems(2).Text & ";" _
ListView1.SelectedItems(0).SubItems(3).Text & ";" _
ListView1.SelectedItems(0).SubItems(4).Text

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here it is.
Almost an exact copy of my previous solution, with the alterations to match your project.

Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp
   Try
      Dim stringToFind As String = ListView1.SelectedItems(0).Text

      PnlDelete.BackgroundImage = My.Resources.POS_Btn_Up
      ListView1.SelectedItems(0).Remove()

      Dim line As String
      Dim input As StreamReader
      Dim strFile As New ArrayList
         
      input = File.OpenText("C:\Documents and Settings\Desktop\BillPaymentRecords.txt")

      While input.Peek <> -1
         line = input.ReadLine

         If Not line.Contains(stringToFind) Then
            strFile.Add(line)
         End If
      End While

      input.Close()

      If File.Exists("C:\Documents and Settings\Desktop\BillPaymentRecords.txt") Then
         File.Delete("C:\Documents and Settings\Desktop\BillPaymentRecords.txt")
      End If

      Dim writer As New StreamWriter("", True)
      For Each item As String In strFile
         writer.WriteLine(item)
      Next
      writer.Flush()
      writer.Close()

      GetFileContents()

      lblBillAmountValue.Text = Format(dTotal, "#,###,##0.00")
      lblServiceCharge.Text = Format(ServiceC, "#,###,##0.00")
   Catch ex As Exception
      MsgBox(ex.Message)
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You can download icons from any free icon repository on the internet.

Then go the project properties and select the Application tab.
There you can see a dropdown box called Icon. Select <Browse...> from the list and select the icon image you just downloaded.
Save.

Aaaand, your done. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

label1.BackColor = Color.Transparent

Oxiegen 88 Basically an Occasional Poster Featured Poster

I posted the answer to a similar problem i May.
Perhaps it could be of some help: deleting a line from text file using VB.Net and edit

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ah. Now I see.
Ok, try this:

If TopRecords > 0 Then
   Rec = 1
   Do While Not EOF(FF)  '<<--- Replace the For loop with this While loop
      'UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. 
      FileGet(FF, TopData, Rec) 
      '
      If TopData.Deleted = True Then
         TopData.ExcelRecord = 0
         TopData.DataSheet = ""
         TopData.TopName = ""
         TopData.TopDate = ""
         TopData.ExcelJobName = ""
         TopData.PipeRecap = ""
         TopData.Catagory = 0
         '
         For X = 0 To 19
            TopData.TopProperties(X) = 0
         Next X
         '
         TopData.Catagory = 0
         TopData.Status = 0
         '
         'UPGRADE_WARNING: Put was upgraded to FilePut and has a new behavior. 
         FilePut(FF, TopData, Rec)
      End If
      '
      Rec += 1
   Loop
End If
Simran Kaur commented: was very helpful & thoughtful +1
Oxiegen 88 Basically an Occasional Poster Featured Poster

SQL has a function called SUM(), which does exactly what the name implies.
So, in your SQL string you can do this:

INSERT INTO dbo.RetailerBalance([BoothID], [GrandTotal], [Accumulated]) VALUES ('" & Form1.txtBoothID.Text & "','" & frmCurrentBalance.lblBalance.Text & "',SUM([GrandTotal]))
Oxiegen 88 Basically an Occasional Poster Featured Poster

You should look into the uses of StreamReader and StreamWriter.

'Reading files
Private Sub ReadFile(Filename As String)
   Dim stream As New IO.FileStream(Filename, IO.FileMove.Open)
   Dim sr As New IO.StreamReader(stream)
   Dim line As String = ""

   While sr.Peek <> -1  'Read until EOF
      line = sr.ReadLine
   End While
   sr.Close()
   stream.Close()
End Sub

'Writing to files
Private Sub WriteFile(Filename As String)
   Dim stream As New IO.FileStream(Filename, IO.FileMode.Create)
   Dim sw As New IO.StreamWriter(stream)

   sw.WriteLine("Here's some text to write on a line") 'Automatic linebreak in file
   sw.Flush()
   sw.Close
   stream.Close()
End Sub
Simran Kaur commented: was helpful +1
Oxiegen 88 Basically an Occasional Poster Featured Poster

You're welcome. :)
Please mark this thread as solved if your problem is fixed.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I suggest this project: http://www.codeproject.com/KB/audio-video/SoundClass.aspx.

You can always find an answer if you google it.

Oxiegen 88 Basically an Occasional Poster Featured Poster

The Left property is the horizontal position of the panel within it's parent container, there is no Right property.
If you need to move the panel from left to right, then you have to change the value of Left.

Panel122.Left = 0, means that the panel is at it's left-most position.
Panel122.Left = parent.Width, means that the panel is at it's right-most position.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Than LCASE() is the way to go.

Oxiegen 88 Basically an Occasional Poster Featured Poster

That is one of the most undescriptive error messages I've ever seen.

But you can probably eliminate the problem if you change LOWER() to LCASE(), , but because I don't know if you are using SQL Express or MS Access as a database, you just have to try your luck with the trial-and-error approach.

Also, I surely hope that you just didn't copied my snippet and thought it would work.
I have no idea how you store a customers name, either in one single column or in two.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If the customers full name is stored in one single string, then what you have is perfectly fine.
However, you might wanna consider performing the check in all lower case.
Like so:

Dim sqlQRY As String = "SELECT COUNT(*) AS numRows FROM CustomerInformation WHERE LOWER(CustomerName) = '" & TextBox1.Text.ToLower() & "'"

But if name and surname are separate entities, then you need to do this:

Dim sqlQRY As String = "SELECT COUNT(*) AS numRows FROM CustomerInformation WHERE LOWER(CustomerName) = '" & TextBox1.Text.ToLower() & "' AND LOWER(CustomerSurname) = '" & SurnameTextBox.Text.ToLower() & "'"
Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm not surprised.

'Change this line
If value1 = r2 Then
' to this
If value1 = value2 Then
Oxiegen 88 Basically an Occasional Poster Featured Poster

According to the snippet you just posted, I'd have to say yes.
Change line 1 to simply say: Dim rnd As New Random().
And keep lines 2 and 3.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Obviously.
But if they weren't. How would they get there?

In order to speed this up a bit.
The answer to your question is Yes, you will need to have some kind of entry control, like a textbox.
One textbox where you enter what to search for, and one textbox where you enter the replacement value.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Gee, I don't know.
If you, somewhere, on the form need to select a value to search for and, somewhere else, a value to replace it.
Consider how you would go about doing it.

Take your code snippet for example.
How would you get the value &H12CC0 if you didn't hard-code it?
Same goes for the line bw.write("1"), where would that value come from?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Change it to this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click      
   If Gcoinspoint <= 0 Then
      'Here you can choose to reset Gcoinspoints to 50
   End If
   Gcoinspoint -= 5