item not found

A

Alejandro Carnero

I have this code , my problem is
if the line
Me.Lista69.RowSource = "select idvenda,codigo,produto,qtd,unit,total from
tbvenda WHERE nvenda like " & nven & " "
do not find any item how i display a warning "ITEM NOT FOUND"??
thanks by any help

Alejandro Canero
Santos-Brazil




Private Sub Comando73_Click()
Dim nven, index As Integer
Dim totg, ctot As Double
nven = Me.NVENDA2
DoCmd.SetWarnings False
DoCmd.OpenQuery "inse_ven1"
DoCmd.SetWarnings True
Me.Lista69.RowSource = "select idvenda,codigo,produto,qtd,unit,total from
tbvenda WHERE nvenda like " & nven & " "
Me.Lista69.Requery
totg = DSum("total", "tbvenda", "nvenda=" & nven)
Me.SUBTOTAL = totg
'Me.tge = totg
Me.quant = " "
Me.pesquisa = " "
Me.Desconto.Requery
Me.pesquisa.SetFocus
End Sub
 
K

Klatuu

You could use a DCount filtered the same as the query to see if any matching
records exist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top