How to make a field required in a Form in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I would like to do is set a value like N/A to a field when it didn't had
information. For example, in a form asking if your married and you're not
then show automatically N/A in the husband name if the user didn't type
anything. This is because I don't want blank fields in a form. Note: The
forms isn't attach to a table in Access.
 
How do you know that the question was overlooked? I like
to design forms where a value or "N/A" is required. If it
is because of analyzing later there are ways around it.

Chris
 
Why do you care if fields are blank? This seems like a lot of coding for no
benefit. Also, if the form is not bound to a table, what happens to the
data?
 
I won't know if the question was overlooked or just missed. But no matter
why the field is blank I don't want it print that way. I'm doing some new
menber forms for Credit unions.
 
If you are printing something based on the form, then don't worry about what
is on the form. If a field is left blank, then deal with it in your report.

In your REPORT just use unbound controls with an IF statement that says

= IF (IsNull(Forms!YourForm.[SomeField]),"N/A",Forms!YourForm.[SomeField])

I think that sytax is correct. I did not test it, just aircode.
 
One more question, why is this an unbound form? You don't want to store any
of the data you enter here? Don't you need to retain the data for future
use?

--
Rick B



Rick B said:
If you are printing something based on the form, then don't worry about what
is on the form. If a field is left blank, then deal with it in your report.

In your REPORT just use unbound controls with an IF statement that says

= IF (IsNull(Forms!YourForm.[SomeField]),"N/A",Forms!YourForm.[SomeField])

I think that sytax is correct. I did not test it, just aircode.

--
Rick B



jeannette_rivera said:
I won't know if the question was overlooked or just missed. But no matter
why the field is blank I don't want it print that way. I'm doing some new
menber forms for Credit unions.
 
jeanette,
Regardless of why you want to do it is immaterial. How you do it depends on
where you want to see the N/A. If you want it on your form, you could make
"N/A" the default value for the text box where the user would enter the name.
If you want it to stay blank until they complete entry on the form, then
perhaps in the Before Update event of the form, you could do like:

If IsNull(Me!txtSpouce) or Me!txtSpouce = "" Then
Me!txtSpouce = "N/A"
End If

You could also make "N/A" the default value for the field in the table.

If it is that you want it to show the "N/A" on a report, then you could
leave it blank on the form, which means it would be blank in the table, and
use the logic above in the On Format event of the section of the report.

Or, you could issue all your users magic markers and they could write it in ;)
 
Actually, those are forms to be filled by new clients and this is better than
handwritting. Blank fields are like you forgot something and it also will be
too much work wor the employees to type n/a in every unused field in a form
with 100 fields, like a new loan application.
 
Ah. I think you misunderstand "form" here. Access is not really designed
to make printed business forms and contracts using the Access FORMS. Those
forms are for onscreen data entry, viewing, and editting. Access REPORTS
are for printing.

If you want to build a form that is printed, I'd suggest either building it
as a report, or using a more appropriate tool. Word or Excel would be much
better suited to that task if all you have is MS Office. There are many
programs out there specifically for creating printed business forms.

All that said, if you plan to add these folks as customers later and store
them in your database, then go ahead and do it right. Fill in all the data
on a bound form. Print a report that uses the stored data from the table.
If the user does not open an account, either delete the record, or flag it
as declined and save it for a set amount of time. If they do become a
customer, then all the data is there.

Another advantage here, what if you need to REPRINT a document after you
close that unbound form? You have to start all over.

Just my opinion,
 
Where should I put this code in the Form? Visual Basic, a macro.

Rick B said:
If you are printing something based on the form, then don't worry about what
is on the form. If a field is left blank, then deal with it in your report.

In your REPORT just use unbound controls with an IF statement that says

= IF (IsNull(Forms!YourForm.[SomeField]),"N/A",Forms!YourForm.[SomeField])

I think that sytax is correct. I did not test it, just aircode.

--
Rick B



jeannette_rivera said:
I won't know if the question was overlooked or just missed. But no matter
why the field is blank I don't want it print that way. I'm doing some new
menber forms for Credit unions.
 
You don't. You leave the field blank on the form. You tell your REPORT how
to handle a blank entry.

--
Rick B



jeannette_rivera said:
Where should I put this code in the Form? Visual Basic, a macro.

Rick B said:
If you are printing something based on the form, then don't worry about what
is on the form. If a field is left blank, then deal with it in your report.

In your REPORT just use unbound controls with an IF statement that says

= IF (IsNull(Forms!YourForm.[SomeField]),"N/A",Forms!YourForm.[SomeField])

I think that sytax is correct. I did not test it, just aircode.

--
Rick B



jeannette_rivera said:
I won't know if the question was overlooked or just missed. But no matter
why the field is blank I don't want it print that way. I'm doing some new
menber forms for Credit unions.

:

How do you know that the question was overlooked? I like
to design forms where a value or "N/A" is required. If it
is because of analyzing later there are ways around it.

Chris

-----Original Message-----
What I would like to do is set a value like N/A to a field
when it didn't had
information. For example, in a form asking if your
married and you're not
then show automatically N/A in the husband name if the
user didn't type
anything. This is because I don't want blank fields in a
form. Note: The
forms isn't attach to a table in Access.
.
 
What the Credit Union do right now is fill the documents in handwriting and
them type the information in their own software. After thet they scan the
documents in the image program and discard the originals.

What we want is to fill the application in the PC and make sure the
documents are always legible.

The problem is the software didn't provide the applications, contracts and
other documents

Rick B said:
One more question, why is this an unbound form? You don't want to store any
of the data you enter here? Don't you need to retain the data for future
use?

--
Rick B



Rick B said:
If you are printing something based on the form, then don't worry about what
is on the form. If a field is left blank, then deal with it in your report.

In your REPORT just use unbound controls with an IF statement that says

= IF (IsNull(Forms!YourForm.[SomeField]),"N/A",Forms!YourForm.[SomeField])

I think that sytax is correct. I did not test it, just aircode.

--
Rick B



jeannette_rivera said:
I won't know if the question was overlooked or just missed. But no matter
why the field is blank I don't want it print that way. I'm doing some new
menber forms for Credit unions.

:

How do you know that the question was overlooked? I like
to design forms where a value or "N/A" is required. If it
is because of analyzing later there are ways around it.

Chris

-----Original Message-----
What I would like to do is set a value like N/A to a field
when it didn't had
information. For example, in a form asking if your
married and you're not
then show automatically N/A in the husband name if the
user didn't type
anything. This is because I don't want blank fields in a
form. Note: The
forms isn't attach to a table in Access.
.
 
Back
Top