Help needed with databases!

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help Needed in access database 0
can anyone help me plzz 10
problem in the code 0
Issues in access 2
Error ! 1
help in query! 4
Syntax error in query! 1
Ken Snell's Export to multiple Spreadsheets 9

Top