Access 2010 VBA - Error "The types do not match" in IF

0

In a VBA code of a button of an Access form, I have the following code:

The result is an error like this:

What is owed and how to solve it?

    
asked by AccessOPS 09.07.2018 в 12:05
source

1 answer

0

First, whenever you put code, put it as text, never as an image, please. .

Second, you use IsNull only once. But looking at your code, I understand that you want to check if any of the 4 fields is null. As you have written it, you are only checking the first one. The correct sentence would be something like:

If IsNull(campo1) = True Or IsNull(campo2) = True Or IsNull(campo3) = True Or IsNull(campo4) = True Then

I would copy it with your data, but as you have put the code as an image ....;)

    
answered by 10.07.2018 / 13:13
source