runtime 3464 data type mismatch

  • Thread starter graeme34 via AccessMonster.com
  • Start date
G

graeme34 via AccessMonster.com

Hi I am getting a data type mismatch message for the following criteria on
the dlookup function.

If IsNull(DLookup("[SalesOrderNumber]", "tblSalesOrderLine", _
"[SalesOrderNumber] = ' " & Me!txtSalesOrderNumber & " ' ")) Then
MsgBox "Sorry you cannot save this Order " _
& "at this time as there are no order details entered" _
, vbOKOnly, "NO DETAILS ENTERED"
Exit Sub
End If

Both fields are of type long integer, I can only assume it is a syntax error
on the first part of the criteria as during the debugging the second part Me!
txt etc is showing a value of 6, the value on the order form.

What I am trying to do is stop users closing the order form if the subform
(order details) is empty.
 
A

Alex Dybenko

Hi,
numeric values you don't need to put in quotes:
If IsNull(DLookup("[SalesOrderNumber]", "tblSalesOrderLine", _
"[SalesOrderNumber] = " & Me!txtSalesOrderNumber & "")) Then
 
G

graeme34 via AccessMonster.com

Hi Alex

I thought it was a syntax error, quite new to programming so thanks for your
help.
Much appreciated :)
Alex said:
Hi,
numeric values you don't need to put in quotes:
If IsNull(DLookup("[SalesOrderNumber]", "tblSalesOrderLine", _
"[SalesOrderNumber] = " & Me!txtSalesOrderNumber & "")) Then
Hi I am getting a data type mismatch message for the following criteria on
the dlookup function.
[quoted text clipped - 15 lines]
What I am trying to do is stop users closing the order form if the subform
(order details) is empty.
 

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