Fred, I inserted your suggested code into other forms I
have made on this database, and it works like a champ! I
have one, and of course it is the one that I started and
am having trouble with, that is a little different. The
Form is based on a Query that prompts for a name or
partial name, and returns the record/s. Following is the
SQL for the query:
SELECT Membership.*, Membership.Memnum, Membership.Addr1,
Membership.Addr2, Membership.[City/State],
Membership.Zip, Membership.SSN, Membership.SPUSSN,
Membership.Location, Membership.Amount,
Membership.Register, Membership.Phone, Membership.Comments
FROM Membership
WHERE (((Membership.Name) Like [Forms]!
[F_Flind_Member_Name]![Name] & "*"));
Does this help? I really appreciate your help.
-----Original Message-----
Is MemNum included in the Form, as well as in the Report?
Are you absolutely sure it is spelled properly?
"MemNum" is not the same as "Men Num" or "Mem_Num"
The code you are using is correct if MemNum is a Number datatype.
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
Jim said:
Fred, now I am getting an error that states Access can't
find the field 'Memnum' referred to in the expression.
Following is the code: DoCmd.OpenReport "Labels
Membership", acViewPreview, , "[Memnum] = " & [Memnum]
Memnum is the primary key field in the database and it is
numeric. What am I doing wrong?
-----Original Message-----
I am needing a way where I can automatically
print a label when this check box is selected from
the
Form.
I guess I mis-understood your question.
To print out just the current record shown on the form,
just code the command button:
DoCmd.OpenReport "Report Name",
acViewPreview, , "[RecordID] = " &
[RecordID]
where [RecordID] is the unique prime key field, and is a
Number datatype.
If [RecordID] is a Text datatype, then use:
[RecordID] = '" & [RecordID] & "'"
The check box does not need to be checked.
Change [RecordID] to the actual name of the record's
prime key field.
Change acViewPreview to acViewNormal to print without
previewing.
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
Fred, I appreciate the help on this. Your code worked
great. What this does though, is print all the records
that have a check mark. I was looking at something that
will leave the checkmark in place but just print that
one
record at the time it is being selected. I am trying to
send the selected customer name and address to a label
printer, instead of using a sheet of labels.
-----Original Message-----
Jim,
Make a Label report.
Make sure the check box is bound to the record.
Then code a Command Button Click event:
DoCmd.OpenReport "LabelReportName",
acViewPreview, , "[CheckBoxName] = -1"
Place a check mark in each record for which you wish
to
have a label
printed.
Press the command button.
To then clear the existing check mark after printing,
add another command
button.
Name it "Clear Check Marks"
Code it's Click Event:
CurrentDb.Execute "Update TableName Set TableName.
[CheckBoxName] = 0;",
dbFailOnError
Change all the report, table and field names above to
whatever the actual
names are.
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
I have a Form that is based on a query that shows
customer information, plus it has a check box that
can
be
selected. I am needing a way where I can
automatically
print a label when this check box is selected from
the
Form. Thanks in advance.
.
.
.