Highlight required fields ?Code not working - TechRepublic
Question
June 1, 2009 at 12:40 PM
eckardtk

Highlight required fields ?Code not working

by eckardtk . Updated 17 years, 1 month ago

Hallo
The following link/ article recommends putting code both in the On Current Property and the After Update Event Property. The code is the same for both properties. It should highlight the required field while it is empty and then the background colour should revert back to white when data have been entered.

I copied the code (shown below) as is. Unfortunately, the required field stays red even after data have been entered.

I understand so little about code that I have no idea how to make this work as planned. Any suggestions ?

The link: http://www.techonthenet.com/access/forms/change_bg.php

The recommended code:
If IsNull(ContactTitle) = True Then
ContactTitle.BackColor = vbRed
Else
ContactTitle.BackColor = vbWhite
End If

ALSO, this code seems to be good only for one field ? I have several required fields. Could I replace ?ContactTitle? from the sample with a string of (Field1;Field2;Field3; .. etc.)? Do I use commas, semicolons or colons as separators ?

This discussion is locked

All Comments