![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
hi, i was trying to compare an attribute (DTPanel ) of Testtable for 4 vehicles of a particular OEM,Vehicle model and model year....... i just started off with this code...am not sure how to frame the query....could anyone help me on th same.....am a beginner Option Compare Database On Error GoTo ProcError Dim strValueList$ Dim rs As DAO.Recordset Dim strSQL As String, strTemp As String Dim i As Integer Dim count As Integer i = 0 If chkIncludeDTPanel.Value = -1 Then strSQL = "SELECT DTPanel FROM TestTable INNER JOIN VehicleTable" & _ " ON TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID" & _ " WHERE VehicleTable.OEM = """ & Me.cboOEM.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.cboModelYear.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM2.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel2.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear2.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM3.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel3.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear3.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM4.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel4.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear4.Column(1) 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 txtResults.Value = strTemp ExitProc: ' Cleanup On Error Resume Next rs.Close: Set rs = Nothing Exit Sub ProcError: MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Error in procedure cmdPerformSearch_Click..." Resume ExitProc End Sub |
#4
| |||
| |||
|
|
Hi I am at a loss to understand why you would not use Pick Basic and AQL/English/Recall depending on which MV platform you are running. Certainly something like SSELECT TESTABLE BY DTPANEL WITH OEM = "1" "2" "3" "4" AND WITH MODEL ="1" "2" "3" "4" AND WITH YEAR "2006" seems a heck of a lot easier than all that SQL Regards Peter McMurray "kanthi" <kanthir (AT) gmail (DOT) com> wrote in message news:1143040443.100302.83220 (AT) u72g2000cwu (DOT) googlegroups.com... hi, i was trying to compare an attribute (DTPanel ) of Testtable for 4 vehicles of a particular OEM,Vehicle model and model year....... i just started off with this code...am not sure how to frame the query....could anyone help me on th same.....am a beginner Option Compare Database On Error GoTo ProcError Dim strValueList$ Dim rs As DAO.Recordset Dim strSQL As String, strTemp As String Dim i As Integer Dim count As Integer i = 0 If chkIncludeDTPanel.Value = -1 Then strSQL = "SELECT DTPanel FROM TestTable INNER JOIN VehicleTable" & _ " ON TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID" & _ " WHERE VehicleTable.OEM = """ & Me.cboOEM.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.cboModelYear.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM2.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel2.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear2.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM3.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel3.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear3.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM4.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel4.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear4.Column(1) 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 txtResults.Value = strTemp ExitProc: ' Cleanup On Error Resume Next rs.Close: Set rs = Nothing Exit Sub ProcError: MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Error in procedure cmdPerformSearch_Click..." Resume ExitProc End Sub |
#5
| |||
| |||
|
|
Because he has moved on from green screen and is developing in VB ! On Thu, 23 Mar 2006 01:45:01 GMT, "Peter McMurray" excalibur21 (AT) bigpond (DOT) com> wrote: Hi I am at a loss to understand why you would not use Pick Basic and AQL/English/Recall depending on which MV platform you are running. Certainly something like SSELECT TESTABLE BY DTPANEL WITH OEM = "1" "2" "3" "4" AND WITH MODEL ="1" "2" "3" "4" AND WITH YEAR "2006" seems a heck of a lot easier than all that SQL Regards Peter McMurray "kanthi" <kanthir (AT) gmail (DOT) com> wrote in message news:1143040443.100302.83220 (AT) u72g2000cwu (DOT) googlegroups.com... hi, i was trying to compare an attribute (DTPanel ) of Testtable for 4 vehicles of a particular OEM,Vehicle model and model year....... i just started off with this code...am not sure how to frame the query....could anyone help me on th same.....am a beginner Option Compare Database On Error GoTo ProcError Dim strValueList$ Dim rs As DAO.Recordset Dim strSQL As String, strTemp As String Dim i As Integer Dim count As Integer i = 0 If chkIncludeDTPanel.Value = -1 Then strSQL = "SELECT DTPanel FROM TestTable INNER JOIN VehicleTable" & _ " ON TestTable.DoorTrimPanelID = VehicleTable.DoorTrimPanelID" & _ " WHERE VehicleTable.OEM = """ & Me.cboOEM.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.cboModelYear.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM2.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel2.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear2.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM3.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel3.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear3.Column(1) & """" & _ " AND VehicleTable.OEM = """ & Me.CboOEM4.Column(1) & """" & _ " AND VehicleTable.VehicleModel = """ & Me.CboVehicleModel4.Column(1) & """" & _ " AND VehicleTable.ModelYear = " & Me.CboModelYear4.Column(1) 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 txtResults.Value = strTemp ExitProc: ' Cleanup On Error Resume Next rs.Close: Set rs = Nothing Exit Sub ProcError: MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Error in procedure cmdPerformSearch_Click..." Resume ExitProc End Sub |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
The assumption being made here is that the OP was made to the correct group --> BIG possibility this guy isn't using mv database |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
The assumption being made here is that the OP was made to the correct group --> BIG possibility this guy isn't using mv database |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |