Help with a search query

woknick

Registered User.
Local time
Today, 02:17
Joined
Sep 25, 2004
Messages
85
Here is what I want to do

Im writing a barcode scanning app and my problem is that when I scan the item I want to bypass the duplicate error message. I am trying to to run an SQL statment that will search the barcode table before the update to check if that barcode is being used. If it is I want another form to open, else add barcode.

I cannot figure out how to retun a value from my search query and then use that value in my IF statement to perform the above.

Please let me know

thanks in advance
 
Can you use the EOF property of the RecordSet?

Dim con As Object
Dim rs As Object
Dim stSql As String
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
sSQL = "select from barcodetable where barcode=" & barcode
rs.Open stSql, con, 1 ' 1 = adOpenKeyset

If (rs.EOF) Then
add a new one
else
blah blah blalh
 

Users who are viewing this thread

Back
Top Bottom