i have 2 tables 'news' and 'news_dev' each has a isapproved tick-box
i am trying to copy the data from 'news_dev' into news but only if they have a tick and also if its a new record that is ticked add the new record to the 'news' table
my first method was this
Sub NewsBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("databasehere") & "")
AccessConn.Open()
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("DELETE * FROM news", AccessConn)
AccessCommand.ExecuteNonQuery()
Dim AccessCommand2 As New System.Data.OleDb.OleDbCommand("INSERT INTO news SELECT * FROM news_dev WHERE isapproved", AccessConn)
AccessCommand2.ExecuteNonQuery()
sucsessLabel.Visible = true
sucsessLabel.Text = "News Updated"
AccessConn.Close()
End Sub
Now this worked BUT if you untick an item in 'news_dev' it removes it from 'news' which is not what i want.
So basically im trying to update one table from anther based on a tick and if a record is ticked in one and not in the other table then add it.
Hope all this makes sense cos my head it fried but any help would be most appreciated.
Cheers Andy