Hi,

I have a doubt. I am using microsoft access as my database. I want to extract various information from different tables based on one primary key, the user id. What i want is to extract information from the two tables based on the user id.

I also want deatils displayed only if present date corresponds to the date in another table. The matchNo corresponding to that date should also be the same as that of corresponding to the userid.

I have written the following code but i am not sure if i am correct. I hope someone can guide me. Thanx

P
VB Code:
  1. rivate Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
  2.         Dim dbCon As New OleDbConnection(ConnectionString)
  3.         Dim dbCommand As OleDbCommand
  4.         Dim MatricNo As String
  5.         Dim day As Date
  6.         Dim MatchNo As New Integer
  7.         MatricNo = txtPMatricNo.Text
  8.         day = day.Date
  9.         dbCon.Open()
  10.         dbCommand = New OleDbCommand("SELECT * FROM MatchesWSinglesRound1,MatchesMDoublesRound1,Matches WHERE MatchesMDoublesRound1.MatricNo = '" & MatricNo & "', MatchesWSinglesRound1 = '" & MatricNo & "',Matches.MatchDay = '" & day & "',Matches.MatchNo = '" & MatchesWSinglesRound1.MatchNo & "',Matches.MatchNo = '" & MatchesMDoublesRound1.MatchNo & "'", dbCon)
  11.         dbCommand.ExecuteNonQuery()
  12.         dbCommand.Dispose()
  13.         dbCon.Close()
  14.     End Sub