hi,
Is there something wrong with this code?
Reader.New1
command.CommandText= "SELECT ProductName,SellPrice FROM [Products] WHERE ProductNo ='" & ProdCode & "'"
reader.Value=Command.ExecuteReader
If reader.ReadNextRow=True Then
SlblDescription.Text = Reader.GetValue(0)
ProdPrice= Reader.GetValue(1)
Else
StxtQty.Text=0
ProdPrice=0
StxtProdCode.Text=""
StxtProdCode.Focus
End If
Reader.Close
The program drops through ok to the if statement but if the condition is false it does not drop to the else part
:sign0104:
This also does not work for the else. what am i doing wrong?
If tblBarcodes.RowCount>0 Then
ProductCode=StxtProdCode.Text
GetProduct(ProductCode)
Else
Msgbox("Barcode Not Recognised","",cMsgboxOK,cMsgboxExclamation)
StxtProdCode.Text=""
StxtProdCode.Focus
End If