Object Required - error 424

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

Do you really have a space before the dot? If so, VBA would be expecting a
with/end with construct:

with txtModel
if<space(s)>.Value ...
end with

In that example, .Value would refer to the "with" item: txtModel. This is a
coding technique for avoding multiple references to the item, when you want
to set several properties of one item.

Otherwise, you should drop the space:

if txtModel<no space!>.Value ...

Also, I think that IS NOT NULL is only valid in SQL (but I don't have Access
here to check). In VBA, use the IsNull() function:

if Not IsNull (txtModel) then ...

HTH,
TC
 
I have a textbox control named txtModel in a form I am designing. I tried
writing code which included:

If txtModel .Value Is Not Null Then .....

This returned the error 424 message - "Object required". I solved my
problem by writing:

If txtModel .Value <> "" Then ....

This works. However, I am not very happy that I do not understand what is
going on. Obviously my knowledge of Access needs improving. Can anyone
please explain? Do I have to declare a Control object or something?

Leonard Priestley
 
Back
Top