VBA simple error?

artsalive

Registered User.
Local time
Today, 18:26
Joined
Oct 1, 2003
Messages
18
I have probably fooled myself but can anyone see why the following always results in a message box coming up saying "error"?

-------------
Private Sub filmid_AfterUpdate()

Dim Msg As String

If [filmid].Column(3) >= [datefield] Then MsgBox "error"

End Sub
-----------------

The filmid is a combo box with the name of the film being booked. Column(3) holds the date that one can start booking the film from. (This is correct as when I put a watch on it, the date comes up.)

The datefield is the date one is trying to book the film for.

Whether the date in filmid/column is higher or lower than datefield the msg box always comes up - how is this possible?!

Many thanks
Ian
 
The date in the combobox is a text date, the datefield is most likely a date field, you have to wrap the text date (as long as it is the proper format) in #'s.
 
Thanks a lot. That didn't occur to me, but seems to be the problem.

Cheers
Ian
 

Users who are viewing this thread

Back
Top Bottom