G
Guest
I am trying to write a macro that will bring up an error message if the data
entered on a form does not match the data already entered into the database.
I know I have to use the MsgBox arguement, but I am having trouble with the
condition.
As an example, if the user enters "James" into the First Name field on the
the form, but the database record has "Jim", I need the error message to
alert the user that the data does not match. The form has three separate
fields that will require this error message [First Name], [Last Name], and
[Category].
I also have a fourth error message if all three of those fields are left
blank. The condition for the fourth error message follows, but it does not
work.
[Forms]![criteria]![First Name]="" AND [Forms]![criteria]![Last Name]="" AND
[Forms]![criteria]![Category]=""
Nothing happens for this fourth error message when I test the form leaving
the three fields blank.
Any help would be appreciated. I am not very good with macros yet.
entered on a form does not match the data already entered into the database.
I know I have to use the MsgBox arguement, but I am having trouble with the
condition.
As an example, if the user enters "James" into the First Name field on the
the form, but the database record has "Jim", I need the error message to
alert the user that the data does not match. The form has three separate
fields that will require this error message [First Name], [Last Name], and
[Category].
I also have a fourth error message if all three of those fields are left
blank. The condition for the fourth error message follows, but it does not
work.
[Forms]![criteria]![First Name]="" AND [Forms]![criteria]![Last Name]="" AND
[Forms]![criteria]![Category]=""
Nothing happens for this fourth error message when I test the form leaving
the three fields blank.
Any help would be appreciated. I am not very good with macros yet.