hello guys, i really need help....i have a transaction table in ms access N i want to retrieve last 10 transaction from the table from my vb form...how am i suppose to do it???i used the folloing code but it is displaying all transactions of a specific account number. N i just need the last ten. Plz gimme some ideas.
Private Sub btnClick_Transactions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick_Transactions.Click
Dim BalConn As OleDb.OleDbConnection
Dim dsBal As DataSet
BalConn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database\VB.net.mdb")
Dim strSQL As String
dsBal = New DataSet
strSQL = "select * from tbl_Transactions where Account_Number='" & UserAccGlobal_Login & "'"
Try
BalConn.Open()
Dim daMyAdapter = New OleDb.OleDbDataAdapter(strSQL, BalConn)
daMyAdapter.Fill(dsBal, "Account_Number")
datTransactions_Grid.DataSource = dsBal
datTransactions_Grid.DataMember = "Account_Number"
Catch ex As Exception
MessageBox.Show(ex.Message, "Exception Raised")
Finally
BalConn.Close()
End Try
End Sub
Private Sub frmTransactions_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
ClosingTransaction.Enabled = True
End Sub