Simple text field comparison to blanks

Egghead

Registered User.
Local time
Yesterday, 23:40
Joined
Jul 12, 2012
Messages
12
I'm using Access and VB for the first time, trying to develop an application for hobby use. I built and populated my database, and I'm building my first module. Unfortunately, one of the most simple actions is tripping me up. I'm attempting to perform an action only if a 255-character text field in a file doesn't contain data, but comparing it to " " or "Space$(n)" doesn't yield the actions I'm expecting.

I've searched MSDN and various on-line resources, but I'm just not finding the answer. I'm embarrassed to ask such a simple question here, so if there's a good basic Access/VB site that covers such basics for newbies, I'd appreciate hearing about it.

Thanks for your time.
 
Last edited:
I assume you mean a text field of 255 characters in a table?

Where are you trying to check from? A Form?

Is the field displayed on the form?

If so, how about:

Code:
If IsNull(Me.MyTextFieldName) OR Me.MyTextFieldName = "" Then
 
Yes, I meant characters and not bytes, thanks for the correction. I updated my post to clarify.

I'm checking the field from a Module, and your code suggestion worked perfectly. Thank you!
 

Users who are viewing this thread

Back
Top Bottom