If Statement

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
 
O

OldPro

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.
 
G

Guest

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
 

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