Getting a combo box to make an "X" on a report

D

Dana

I am attempting to create a database using Access 97 that will, among
other things, fill out an insurance claim form called a HCFA 1500.
This is a pre-printed form that has several fields that need to have
boxes checked. For instance, the form has a check box for "male" or
"female" and for "married," "single," or "other." In my table I have
used a combo boxes for these data. When I create a report, it will
print the words, "single," "married," "female," etc. but what I need it
to do is make an "X" at a particular point on the report to correspond
with the appropriate box in the HCFA 1500 form. For example, I might
want an "X" in the report to be placed 2.5" from the left margin and
4.5" from the top if the value in the Gender combo box is "male" and an
"X" to be placed 2.75" from the left margin and 4.5" from the top if
the value in the Gender combo box is "female."

I do not know code and am not sure where it would go if someone gave it
to me- creating macros is about as sophisticated as I get. Is there a
relatively easy way for me to accomplish this goal?

Thanks in advance for any help you can give me.

Dana
 
A

Arvin Meyer [MVP]

I think you'll need to learn a bit of simple code. Macros are actually much
more complex for something like this. The trick is to scan your form, full
size and then paste the image in an Access report. Place check boxes at
every position and name them so it is easier to keep track of them. So now
let's deal with a combobox named cboGender. Depending if you are storing
numerics (probably 1 or 2) or text ("male" or "female") in the underlying
table, your code would look something like:

Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)

If Me!Gender = "male" Then
Me.chkMale = True
ElseIf Me!Gender = "female" Then
Me.chkFemale = True
Else
Me.chkMale = False
Me.chkFemale = False

End Sub

and repeat the process for each set of fields. After you've placed all your
checkboxes and deleted all their labels, written and tested your code, you
can delete the image so only the checkboxes are left. Instead of checkboxes,
you may want to used small textboxes with the letter "x" in them. That way
you won't need to print the border of the checkbox.
 

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