How to use an If command in an unbound form?

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

Guest

I had some unbound forms and would like to make sure there is information in
every field. And if there is not information available or just N/A then auto
fill the unbund field with N/A.
 
If it is an unbound form then there are no fields, only controls. How about
if you just make N/A the default value of each control?. You could probably
put N/A in every empty control programatically, but what is the point of that
 
The user will move around fields with tab button and if there is no info in
the field would like to have the N/A because I dont want to show blank fields
like missing information.
 
If you mean that when the user exits a field that is still blank you want the
text box to show "N/A" instead, you could put something like this in the Exit
event for the control:
If IsNull (Me.TextBoxName) Then
Me.TextBoxName = "N/A"
End If

If this is an unbound form as you have stated then there are no fields, so
it is difficult to know what to make of your concern regarding blank fields.
Do you mean you don't want to leave controls blank? Are you passing the
values to a report or another form?
 
Maybe I'm not sure how to explain myself because I'm a new user. The form
has several labels with paragraphs of information and some text boxes to fill
some other information. I create the basic documents in Access because I
don't want the members filling forms in handwritting, instead the employees
will type everything and I will get a nice and readable form. I won't save
the information on the fields in an access database. I just need to print
the form with all the fields and thats it in Access. This is because the
software with the database of the credit union didn't have forms and they
need to had lots of inventory on forms, or they make copies of the same
documents again and again and the papers looks real bad.

Thanks for your help.
 
If I understand correctly, you have created a database for the purpose of
printing documents. This is not an appropriate use of a relational database
program. You would be better off using form fields in a protected Word
document. If I have misunderstood, and there is a good reason for using
Access, consider either of my suggestions (N/A as default value, or the
code). You could also use validation to assure that all fields contain a
value, or you could check for blank fields before printing. It would
probably be best if users enter information into a form, then you print a
report based on the form. Text boxes on a report can grow and shrink to
accomodate the text, unlike on a form. The data source for the text boxes on
the report would be the text boxes on the report
(=Forms!FormName!TextBoxName).
 
Back
Top