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

It's the people who believe the world is coming to an end and decide to help the process along that worry me. It also bothers me that the end of the world (a least this week's version) is one day before my birthday. That blows. I guess I'll just have to start celebrating today.

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

I want to get sum of total data where status is "yes"

What you should provide is

  1. the structure of all relevant tables
  2. perhaps a few records with an example of the before and after

This is particularly helpful if you are trying to explain the problem in a language that is likely not your native tongue.

Begginnerdev commented: To eager to solve questions. Sorry. :( +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

On Black Friday, almost 300,000 Americans purchased guns. More than 16.8 million applications for new gun purchases have been made so far this year.

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

It's going to get worse. A Republican Congressman from Texas, Louie Gohmert, says the elementary school principal in Newtown, Conn., should have had a high-powered rifle to take the shooter’s “head off.” Texas Governor Rick Perry says teachers and administrators should be able to carry concealed weapons. And the state of Michigan, just one day before the Newtown school massacre of 26 children and adults, passed a bill to allow the carrying of concealed weapons in schools, daycare centres and places of worship. If guns is the problem then obviously more guns is the solution.

Wanted: School principal. Must be expert marksman.

diafol commented: I'm glad it's not just me that sees the madness of this obsession +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'll remind you of Sturgeon's Law. To wit, "Ninety percent of everything is crap". There are good tutorials out there.

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

Whether or not the specs are adequate depends a lot on what you want to do with it. Document editing doesn't require much power. Hardcore gaming is another matter.

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

Gonna take a shot in the dark. When you have your "disappearing" drive plugged in and visible, run diskmgmt.msc and try assigning a different drive letter to it (try Z:). Then see if it still disappears when another device is plugged in.

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

@MICHAEL - He's doing a post-doc in bio-physics.

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

google this and check out the first three hits.

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

Not by itself, but you might find the source code for a custom control to do that here

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

My Christmas gift is having my older son fly home from Long Island to spend the holidays with us. He's due here Wednesday evening.

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

after finding all the AM in the listview1 to listview2 i will sum all their calls and visits by Month (January to December)

You already have that data in ListView2.

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

IMO I would think that people who are looking for tech help are typically looking for help with programming issues or with operational (configuration, driver, virus, hardware, etc) issues. Tablets are pretty much oriented to content consumers. Programming issues are in the realm of content creators. As for operational issues, from what I know about tablets they are more like appliances rather than tinkertoys. Has anyone seen much in the way of people asking for tech help with tablets other than "how does tablet X compare to tablet Y"? Is this really going to change enough in the near future to make the effort worthwhile?

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

I want to find all the "AM" in my Listview1 to the Listview2

Still unclear. Do you mean you want to find all AM values from ListView1 that exist in ListView2 or do you want to find all AM values from ListView2 that exist in ListView1? Or do you want something else entirely?

Whatever it is that you want, how do you want to present the results?

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

I only put "some text" into the string for testing and to demonstrate that the text is still there inside the event handler. You can assign it any text you want at any point in your code. As tinstaafl points out, if you declare fo1 inside the handler it overrides the global copy with a local one and makes the global fo1 inaccessible.

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

I'm guessing his 500 gig hard drive was flagged by Windows as unpartitioned so he boot into a linux recovery system from USB and reset the partition table. Then it was OK for a while but got reset back to unpartitioned.

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

Your code

Dim path As String = Directory.GetCurrentDirectory() & "\Setings.txt"
If File.Exists(path) Then
    Dim test1 As New System.IO.StreamWriter(path, False)
    test1.WriteLine(fo1)
    test1.Close()
    MsgBox(fo1)
Else
    Dim fs As FileStream = File.Create(path)
End If

will not write anything to the file if the file does not exist. Look at it in pseudo code

compose file name

if the file exists then
    write the contents of fo1 to the file
otherwise
    create the file but don't write anything to it

As I mentioned before, the WriteAllText will create the file if it doesn't exist so you don't need the test. The following seems to be what you intended

Imports System.IO

Public Class Form1

    Public fo1 As String = "some test text"

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

        Dim filename As String = Directory.GetCurrentDirectory() & "\test.txt"
        MsgBox("writing " & fo1 & " to " & filename)
        My.Computer.FileSystem.WriteAllText(filename, fo1, True)

    End Sub

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

how to find all data in my first listview to another

Can you please explain what you mean by this?

TnTinMN commented: and I thought I was the only one who din not comprehend that +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No, but there are certainly a few available at other sites such as this one for VB at msdn. You can easily find more with a little googling. A complete list of msdn tutorials can be found here

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

Perhaps you haven't put any text into fo1. In any case you don't need to have the If. We know the current directory exists and WriteAllText will create the file if it doesn't exist.

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

You could try AutoIT. I've used it to automate several tasks.

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

I thought the current reboot of Batman was the best of all the incarnations. It was done intelligently. It took itself seriously. We had more than enough camp in previous versions thank you very much. It was well cast and well acted. And I thought Heath Ledger gave a truly inspired performance as The Joker.

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

Just finished The Dark Knight Rises. What a remarkable disappointment. Got a good laugh out of the fight scene near the end with Bane and Batman though. Not so much the primaries but the background fighters. You could see a few of them weren't even trying to look convincing. There were just too many WTF moments in the movie.

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

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

        DataGridView1.Rows.Add({"Jim", 12})
        DataGridView1.Rows.Add({"Bob", 19})

    End Sub

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

        Timer1.Enabled = True

    End Sub

    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick

        For row As Integer = 0 To DataGridView1.Rows.Count - 1
            Dim num As Integer = DataGridView1.Rows(row).Cells(1).Value
            DataGridView1.Rows(row).Cells(1).Value = num - 1
        Next

    End Sub

End Class

This is a simple case. You can modify it to handle the date/time as you display it.

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

If you need an "all or nothing" action where if any insert fails then they all fail you will have to create a Transaction and use a Try/Catch so you can roll back the entire transaction on an error.

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

And a part 3.

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

You could create your own class with properties named EmployeeID, LastName and FirstName and create a new list of the new class type or you could use a detached recordset. You could likely also create a database in memory as well using more modern techniques involving datasets/datatables, etc but I am not familiar enough with those to offer suggestions.

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

If you want to copy records from one table to another you have to do an INSERT. Update modifies columns in existing records. The syntax of this type of insert is

INSERT INTO table2 (<list of column names>)
SELECT <list of column names> FROM table1

If the column names are the same in both tables (and are in the same order) you can use

INSERT INTO table2 SELECT * FROM table1

Because you are not allowed to have two records with the same primary key you will have to ensure that the records in table1 do not have a primary key that exists in table2.

If you just want to modify an existing record then you are likely trying to change the primary key column to a value that already exists.

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

NET USE Z: \Servername\sharename /USER:username

The correct syntax is with two leading back slashes as in

NET USE Z: \\Servername\sharename /USER:username
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

ComboBox1.Text is the text from the currently selected item.

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

Doesn't that sound gross

Maybe not when compared to haggis.

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

What is a BondFiled column? Do you mean a bound field column? What kind of data does it contain and what do you want to happen? How will the timer be started and stopped? Do you want one countdown for each record? Details please.

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

When I used to write apps for a living, the problem was keeping the users current. I couldn't push out the updates because a lot of the users had laptops and I could never predict when they'd be on the network. My solution was to put a script under the app icon instead of the app itself. The script would copy any new modules from the repository before launching the actual app.

I'm sure there are more modern ways to do this but I used what was available at the time. It was simple and it worked.

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

The traditional Christmas dinner in England used to be a pig head prepared with a mustard sauce.

And the traditional dessert was the pickled extremeties - a dish called piggy footing.

Sorry. Couldn't resist.

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

I have no experience using DataSets, DataAdapters, DataTables, etc so I can't offer any help on how to bind a DataGridView to a database table. I've only ever used ADO and ADO.NET for database operations. I don't like all the layers of abstraction.

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

It helps if you post the error message, but to add items to a combobox the syntax is

ComboBox1.Items.Add(string value)

in your case

ComboBox1.Items.Add(myReader("Uname"))
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try removing the single quotes from around the numeric fields. You should only use single quotes for string type database values.

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

The OP hasn't been on DaniWeb for almost seven years. There is no need to revive this thread.

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

So in pseudo code

For Each "Code Name" in the listview
    get all calls and visits for that Code Name
Next

and in real code that is

Dim query As String

For Each item As ListViewItem In ListView1.Items
    query = "Select * from [Calls and Visits$] where AM like '" & item.SubItems(1).Text & "%'"
    'execute the query and do something with the results
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The wood burns a lot faster when you have to chop it yourself. Harrison Ford

Some people are born on third base and go through life thinking they hit a triple. Barry Switzer

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

So every time the user clicks on a line in the listview you want to append the value from the Code Name column to AccountName. The query

"Select * from [Calls and Visits$] where AM like '" & AccountName & "%'

will never match any records if AccountName contains more than one Code Name.

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

At line 80 add the following

Debug.WriteLine(cmdUpdate.CommandText)

and post the output here. One further comment, a GOTO is a rarely used feature. There are only a small number of cases where a GOTO is warranted. This isn't one of them.

Replace

If conn.State = ConnectionState.Open Then
    GoTo cont
Else
    If conn.State = ConnectionState.Closed Then
        dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
        dbSource = "Data Source =C:\CGPA\e-CGPA Stat\e-CGPA Stat\bin\Debug\Scoredata.mdb;Persist Security Info=False"
        conn.ConnectionString = dbProvider & dbSource
        conn.Open()
        da.SelectCommand = New OleDb.OleDbCommand("SELECT * FROM 100Level1stSemester WHERE MatNO like '%" +     cmbMATNO.Text + "%'")
        da.SelectCommand.Connection = conn
        Dim mycomand As New OleDb.OleDbCommandBuilder(da)
        da.Fill(ds, "100Level1stSemester")
cont: If cmbCourseLevel.SelectedItem = "100 Level" Then

with

If conn.State <> ConnectionState.Open Then
    dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
    dbSource = "Data Source =C:\CGPA\e-CGPA Stat\e-CGPA Stat\bin\Debug\Scoredata.mdb;Persist Security Info=False"
    conn.ConnectionString = dbProvider & dbSource
    conn.Open()
    da.SelectCommand = New OleDb.OleDbCommand("SELECT * FROM 100Level1stSemester WHERE MatNO like '%" +     cmbMATNO.Text + "%'")
    da.SelectCommand.Connection = conn
    Dim mycomand As New OleDb.OleDbCommandBuilder(da)
End If

If cmbCourseLevel.SelectedItem = "100 Level" Then
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please clarify what you want to do.

i want the AM Field to input in the AccountName

is unclear.

I need to get them and put it on a

Dim AccountName as String

You already have them. They are in the ListView.

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

First of all you have to have some way of relating table1 to table2. You have given no name to the column in table1 (I assume from context that it represents a quantity). You'd have to include an ID column to associate the quantity to an ID.

Also, you should not use DESC as a column name. In some database systems this is a reserved word (indicates a descending order for sorting). Once you have two tables set up as

Temp
   ID
   QTY

Purchases
    ID
    DESCR
    QTY

You can add Temp to Purchases in a query by

select p1.ID, p1.DESCR, QTY=p1.QTY+p2.QTY
  from Purchases p1, Temp p2
 where p1.ID=p2.ID

This will return the results you want in a recordset for display. Note - this does not update the Purchases database. To create a new table from the results do

select p1.ID, p1.DESCR, QTY=p1.QTY+p2.QTY
  into NewPurchases
  from Purchases p1, Temp p2
 where p1.ID=p2.ID
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As you may have guessed, AD & I are both retired (and loving it).

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

HouseCall is not installable. It is meant to be only a stand-alone scanner for infected systems. Supposedly, TM keeps the files up to date. I had a look and SuperAntiSpyware and decided to install it on my machine and give it a go. Thanks for recommending it.

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

I want to learn something new in these vacations.

Learn to relax. It seems to be a lost art.

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

the robot/human said, "Big things have small beginnings".

Hardly an original quote. There is an ancient one about mighty oaks springing from acorns.

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

I feel like my design is actually good in fact one of the best I've written

I refer you to not invented here. I suffer from this particular malady.

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

When you click on a button then the button gets the focus. At that point you don't know what textbox last had focus so you have to keep track of that yourself. When a textbox gets focus, it fires the Enter event. What you can do is create a class level variable and in the Enter event of each textbox (or at least the ones you are interested in) you can assign a reference to that textbox to the class level variable. Here's an example

Public Class Form1

    Private LastFocus As TextBox

    Private Sub TextBox_Enter(sender As Object, e As System.EventArgs) Handles TextBox1.Enter, TextBox2.Enter, TextBox3.Enter
        LastFocus = sender
    End Sub

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

        If Not IsNothing(LastFocus) Then
            LastFocus.Text = TimeOfDay
        End If

    End Sub

End Class

Note that I am using one Enter handler for all three textboxes. Click in any textbox, then click on Button1. The last selected TextBox will be updated.