Hi there! I've been racking my brains out for 4 days and still not getting why is msaccess stubborn about string parsing, first I have a table named tblItems, this table has columns: ProductItem, ItemID. Now I want to search and count my items found and produce the result in a textbox and a label control called: txtItemResult and lblCount so I have the code
this produces unfamiliar errors for me and I appologize for the msgbox, I just want to see if I compared the right string. I know, that I should be using sql count(*) here, to be honestI should have but it dosent give what I want or my understanding is the problem (which is usually the case). The output should be like:
ProductItems
------------
Nylon
Nylon Cable
Nylon hose
Nylon string
there are: 4 items found
pls....pls....p ls, anyone who can put me in the right direction would very appreciated.
Code:
Public Sub StringFinder()
Dim conn1 As ADODB.Connection
Dim rsShowTable As ADODB.Recordset
Dim iResult as Integer
Dim iCounter as Integer
DIm i as String
Set conn1 = New ADODB.Connection
conn1.Provider = "Microsoft.Jet.OLEDB.4.0"
conn1.Open "C:\Apps\dataPMC.mdb"
Set rsShowTable = New ADODB.Recordset
rsShowTable.Open "tblItems", conn1, adOpenDynamic, adLockOptimistic, adCmdTable
i= "NYL"
iResult = StrComp(txtItemsResult.Value, i)
Select Case iResult
Case 1
MsgBox "the first string is greater than the second"
'Iterate through each character
startPosition = InStr(txtActivity.Value, 1)
iCount = iCount + 1
lblCount.Caption = iCount
Me.txtItemsResult.Value = rsShowTable!("ProductItem")
Case Else
MsgBox "One or more strings are null"
End Select
End sub
ProductItems
------------
Nylon
Nylon Cable
Nylon hose
Nylon string
there are: 4 items found
pls....pls....p ls, anyone who can put me in the right direction would very appreciated.
Comment