I have also tried to declare my string value such as:
Dim cnSQL As ADODB.Connection
Dim rsSQL As ADODB.Recordset
Dim strValue As String
Set cnSQL = New ADODB.Connection
Set rsSQL = New ADODB.Recordset
Set strValue = ThisDisplay.StringInput1
.......................more code........................
With rsSQL
.ActiveConnection = cnSQL
.Open "SELECT im_desc_short FROM item_master where im_upc =
strValue"
End With
But this gives me a compile error : object required error.
Thanks!
Hi,
You want to do something like this:
Private Sub Button1_Released()
> Dim cnSQL As ADODB.Connection
> Dim rsSQL As ADODB.Recordset
dim str1 as string
str1 = "SELECT im_desc_short FROM item_master where im_upc = "
' inputbox value is surronded by a doublequote singlequote doublequote
on each side and str1 has the input box result surronded by single quotes.
str1 = str1 & "'" & trim(inputbox1.text) &"'"
> Set cnSQL = New ADODB.Connection
> Set rsSQL = New ADODB.Recordset
[quoted text clipped - 12 lines]
> .Open
> End With
> Hello all,
>
[quoted text clipped - 49 lines]
> Everything works when I remove the where clause. Any assistance is
> greatly appreciated.
jan - 23 Jul 2007 18:21 GMT
> Hi,
>
[quoted text clipped - 79 lines]
> > Everything works when I remove the where clause. Any assistance is
> > greatly appreciated.
Thanks for the reply!! I finally figured it out.