problem in the code

K

kanthi

I have the follwoing code where am trying to display all the
columns(attributes) of a paticular table "TEST" for a particular
vehicle record.

on the user form i have 3 combo boxes wher the user has to select the
OEM ,vehicle model,model year and enable the Checkbox "ALL" and press
the search button.
for some reason i cant figure out what the problem is with the
following code...i am new to access.............can somebosy 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 = strSQL = "SELECT * FROM VehicleTable,TestTable WHERE
TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID AND
TestTable.OEM= Me.Combo160.Value AND
TestTable.VehicleModel=Me.Combo162.Value AND
TestTable.ModelYear=Me.Combo10.Value "

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

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


Top