print a string

M

mcnewsxp

is there a simple way to to pront off the contents of a string variable?
my users want to know which fields are empty on a form then print this out
so they can go about gathering the info via phone fax etc.
i know i can create a report, but can this go strait to a network printer or
into notepad?
or should i create a report with a large textbox?

tia,
mcnewsxp
 
W

Wayne-I-M

There are lots of ways.

1 very simple way is to create a new query and use some If's. So if a field
is null then deisplay some text.
Something like this
1stCheck: IIf(IsNull([TableName]![SomeField]),"SomeField is empty")
2ndCheck: IIf(IsNull([TableName]![SomeOtherField]),"SomeOtherField is empty")
3rdCheck: IIf(IsNull([TableName]![AndAnOtherField]),"AndAnOtherField is
empty")

Or just

SELECT IIf(IsNull([TableName]![SomeField]),"SomeField is empty") AS
1stCheck, IIf(IsNull([TableName]![SomeOtherField]),"SomeOtherField is empty")
AS 2ndCheck, IIf(IsNull([TableName]![AndAnOtherField]),"AndAnOtherField is
empty") AS 3rdCheck
FROM TableName;

Create a report from this query and mail it or print it as needed.

You could filter the report to show Not Nulls (that is fields with the text
in) or some other filter

HTH
 
J

John Spencer

What version of Access?

One way is to create a form with an unbound control - txtMessage

Open the form and pass it the text in the openArgs parameter and then
print the form

DoCmd.OpenForm "MyMessageForm", _
OpenArgs:="Tell the user to get some coffee"

RunCmd acCmdPrint

In the form's open Event, add code to assign the message to the control

Private Sub Form_Open(Cancel As Integer)
Me.txtMessage = Me.OpenArgs
End Sub
 
M

mcnews

What version of Access?

One way is to create a form with an unbound control - txtMessage

Open the form and pass it the text in the openArgs parameter and then
print the form

DoCmd.OpenForm "MyMessageForm", _
   OpenArgs:="Tell the user to get some coffee"

RunCmd acCmdPrint

In the form's open Event, add code to assign the message to the control

Private Sub Form_Open(Cancel As Integer)
    Me.txtMessage = Me.OpenArgs
End Sub

that's exactly what i did do. works fine.
i simply looped through the control array to ferret out the nulls. i
put descriptive text in all of the tool tips.
 

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

Similar Threads


Top