Finding empty fields

Sara Overton

Registered User.
Local time
Today, 20:49
Joined
May 22, 2001
Messages
34
I seem to be unable to write If statements which looks in a field for a empty entries and entries which aren't empty.

I know how to do this in macros, but I'm trying in subforms therefore need to do it in VB code.

Also I need to find fields which contain certain things but can't use the asterix character.

Any ideas am I just being silly?
 
Here is a quick tip for you.

Take any macro and Right click on it and choose SaveAs/Export > Then choose Save as Visual Basic Module > Then uncheck the next two options and click OK.

Access will convert the macro into a VBA Module for you which can be cut and pasted right into a control's event.

Note
Only cut and paste the code between the function lines, and Access does not always produce the most efficient or elegant code this way. For instance, a Setvalue will include [Forms]![FormName]![YourFirstField] instead of using the shorter Me![YourFirstField] or if a macro has optional arguments Access will put quotation marks between the commas instead of leaving them blank.

This is a great way to learn about VBA syntax but not a good way to learn how to code. For that you have to just do it.
 

Users who are viewing this thread

Back
Top Bottom