K
kanthi
I am new to access and i am doing a project where in am developing a
standalone database.
i have 2 tables one is the vehicle table and the other is the door
table. In the search form which i made i have vehiclename,model ,year
and the attributes(columns in door table).
The user selects a particular vehicle,model and yr and specifies the
attribute he wants to search for....
the code written below works for one record how do i do it for multiple
records in door table.
can somebody help me on the same.....
Private Sub Command67_Click()
Dim strValueList$
Dim rs As DAO.Recordset
Dim strSQL, strTemp As String
Dim i As Integer
Dim count As Integer
i = 0
If Check101.Value = -1 Then
strSQL = "SELECT * FROM VehicleTable, TestTable WHERE
TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID"
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
i = 0
count = rs.Fields.count - 1
For i = 0 To count
strTemp = strTemp & rs.Fields(i).Name & ": " & rs.Fields(i) & "
"
Next i
rs.MoveNext
Loop
Else
MsgBox "No Records"
End If
End If
If Check131.Value = -1 Then
strSQL = "SELECT DTPanel FROM VehicleTable,TestTable WHERE
TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID "
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
strTemp = strTemp & rs.Fields(0).Name & " : " & rs.Fields(i) & " "
rs.MoveNext
Loop
Else
MsgBox "No Records"
End If
End If
Text143.Value = strTemp
End Sub
standalone database.
i have 2 tables one is the vehicle table and the other is the door
table. In the search form which i made i have vehiclename,model ,year
and the attributes(columns in door table).
The user selects a particular vehicle,model and yr and specifies the
attribute he wants to search for....
the code written below works for one record how do i do it for multiple
records in door table.
can somebody help me on the same.....
Private Sub Command67_Click()
Dim strValueList$
Dim rs As DAO.Recordset
Dim strSQL, strTemp As String
Dim i As Integer
Dim count As Integer
i = 0
If Check101.Value = -1 Then
strSQL = "SELECT * FROM VehicleTable, TestTable WHERE
TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID"
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
i = 0
count = rs.Fields.count - 1
For i = 0 To count
strTemp = strTemp & rs.Fields(i).Name & ": " & rs.Fields(i) & "
"
Next i
rs.MoveNext
Loop
Else
MsgBox "No Records"
End If
End If
If Check131.Value = -1 Then
strSQL = "SELECT DTPanel FROM VehicleTable,TestTable WHERE
TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID "
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
strTemp = strTemp & rs.Fields(0).Name & " : " & rs.Fields(i) & " "
rs.MoveNext
Loop
Else
MsgBox "No Records"
End If
End If
Text143.Value = strTemp
End Sub