Home All Groups Group Topic Archive Search About

VB6 query format for comparing number value

Author
3 Nov 2006 11:15 AM
prateek
hi all
i am using VB6 and Access
i was trying to select data with a particular value in  a field as

Dim str1 As String
str1 = "select * from booking where psngr_id = '" & Text1.text & "'"
Adobkgview.RecordSource = str1
Adobkgview.Refresh

I am supposed to retrieve records where psngr_id is as typed in the
text box.
it worked fine for the first time. but later it rose error saying text
after text1 is not correct. options to put after text1. are count/ Item
/ Lbound / Ubound .   psngr_id is a number type.
Please give the code
thanks

Author
3 Nov 2006 11:53 AM
rowe_newsgroups
This is a newsgroup for Visual Basic.Net (vb2002, vb2003, vb2005) - and
not classic vb (vb1 - 6). Please find the classic vb newsgroup
(microsoft.public.vb) and search/post there.

Thanks,

Seth Rowe


prateek wrote:
Show quoteHide quote
> hi all
> i am using VB6 and Access
> i was trying to select data with a particular value in  a field as
>
> Dim str1 As String
> str1 = "select * from booking where psngr_id = '" & Text1.text & "'"
> Adobkgview.RecordSource = str1
> Adobkgview.Refresh
>
> I am supposed to retrieve records where psngr_id is as typed in the
> text box.
> it worked fine for the first time. but later it rose error saying text
> after text1 is not correct. options to put after text1. are count/ Item
> / Lbound / Ubound .   psngr_id is a number type.
> Please give the code
> thanks