I have a combo box as Combo1 and I want to get data from sql by using this combo box selected value. For that I did my code inside the click event in my combo box. But it is not ok and it says "method or data member not found".
This is my code,
How can I fix this and how to use combo box to get data from sql?
Thank you
This is my code,
Code:
Private Sub Combo1_Click()
Dim sqlqueryVw As String
Dim LNLOAD As ADODB.Recordset
sqlqueryVw = "select dbo.FRI_MASTER_LineLoading.cLine,dbo.FRI_MASTER_LineLoading.dProdutionStart,dbo.FRI_MASTER_LineLoading.dProductionEnd," _
& " dbo.OPS_MASTER_Style.cStyleNumber,dbo.OPS_REF_GarmentType.cGarmentCode" _
& " FROM dbo.FRI_MASTER_LineLoading inner join " _
& " dbo.OPS_MASTER_Style on dbo.FRI_MASTER_LineLoading.nStyleCode=dbo.OPS_MASTER_Style.nStyleCode inner join " _
& " dbo.OPS_REF_GarmentType on dbo.OPS_MASTER_Style.nGarmentTypeID=dbo.OPS_REF_GarmentType.nGarmentTypeID" _
& " WHERE dEntryDate BETWEEN CONVERT(DATETIME, '" & DTFrom.Value & "', 102) AND CONVERT(DATETIME, '" & DTTo.Value & "', 102) " _
& " AND cFty='" & Combo1.Value & "'"
Set LNLOAD = New ADODB.Recordset
LNLOAD.CursorLocation = adUseClient
LNLOAD.Open sqlqueryVw, cn, adOpenStatic, adLockReadOnly
End Sub
How can I fix this and how to use combo box to get data from sql?
Thank you