Input mask help

G

Gene Hora

Using Access 97 I have a field that requires an optional capital X if a
certain condition exists. None of the mask combinations I tried worked. I'm
somewhat proficient in the program, but have no programming skills. Seems to
me it should be a relatively simple mask, but so far has eluded me. Would
appreciate any wisdom on this.
 
J

John Vinson

Using Access 97 I have a field that requires an optional capital X if a
certain condition exists. None of the mask combinations I tried worked. I'm
somewhat proficient in the program, but have no programming skills. Seems to
me it should be a relatively simple mask, but so far has eluded me. Would
appreciate any wisdom on this.

An Input Mask is a very limited tool - it's simply not capable of
doing this. You'll need some VBA code, and to use a Form to input the
data, since tables don't have any useful VBA events. Could you explain
the conditions, the datatype of the field, and what other values would
be valid?
 
G

Gene Hora

This is a church database and this is a text field (field name "Inactive")
to determine a simple count of inactive members. The intent was to place an
"X" in this field when applicable and obtain the count (& print if
necessary) from a query. The field is already part of a form so if the
proper language could be input I could adapt to that and prepare a report
based on the form. The "X" is artibrary and could be any type of response
that gives a count of this field. The field is used for no other purpose.

Thanks for the quick response.
 
J

John Vinson

This is a church database and this is a text field (field name "Inactive")
to determine a simple count of inactive members. The intent was to place an
"X" in this field when applicable and obtain the count (& print if
necessary) from a query. The field is already part of a form so if the
proper language could be input I could adapt to that and prepare a report
based on the form. The "X" is artibrary and could be any type of response
that gives a count of this field. The field is used for no other purpose.

Take a look a the table in design view. What is the datatype of the
field? What's its Default property?
 
J

John Vinson

The data type is "Text" and Table Properties for this field are all blank

I'd suggest using a Yes/No field instead, and a checkbox control -
this would let the user just click the checkbox with the mouse, or tab
into it and press the spacebar, to toggle the activity status of the
family.

If you really want a text field containing X or nothing, use a
Validation Rule of

= "X" OR IS NULL

on the field (in table design view), and set the input mask to "A" (a
single alphabetic character); train the user that X is the only valid
letter. You could get the X with some VBA code but IMHO the Yes/No
field and a checkbox is easier all around!
 
G

Gene Hora

OK, I'll test both suggestions out. Really appreciate the time and help you
gave to this. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top