If Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry, have I have been working late and can't think straight, but this
should work, it is set to check on the load event of the form. I have two
text boxes, one which looks up a value in a query, which is set to look for
the Max Value in a table field i.e. Version number, and the other text is a
text box (protected) with a default value of the version I am using.

I get this working but for both equal and non equal values. What Am I
missing, am I just being dumb?


If txtVersion <> Me.txtMaxVersion.Value Then
MsgBox "A later version of this database is available to use, please
speak to Someone or Something for more infomation", vbCritical, "Old Version
Detected..."
Else
End If
 
Sorry, have I have been working late and can't think straight, but this
should work, it is set to check on the load event of the form. I have two
text boxes, one which looks up a value in a query, which is set to look for
the Max Value in a table field i.e. Version number, and the other text is a
text box (protected) with a default value of the version I am using.

I get this working but for both equal and non equal values. What Am I
missing, am I just being dumb?

If txtVersion <> Me.txtMaxVersion.Value Then
MsgBox "A later version of this database is available to use, please
speak to Someone or Something for more infomation", vbCritical, "Old Version
Detected..."
Else
End If

Check if either textbox is returning a NULL value.
 
Hi

Should the following...

If txtVersion <> Me.txtMaxVersion.Value Then

be changed to...

If Me.txtVersion <> Me.txtMaxVersion.Value Then

{Added Me. just before txtVersion}

Could add a .Value after as well but I don't think you need it.

hth

Andy Hull
 
Back
Top