How to insert a value into a sentence on a report.

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

Guest

I would like to make a sentence on a report similar to the following.

Patient reprots drinking of alcohol 3 days last week consuming an average
for 5 drinks.

What I would like to know is how to get the # of days into this sentence and
what control to use? So how would I go about setting this up since every
persons # of days will be different for each person?
 
In the field control source write

="Patient reprots drinking of alcohol " & [InsertHereTheFieldName] & " days
last week consuming an average for 5 drinks"
 
Assuming you have two Number fields named Days and Drinks in your table, you
could put a text box on your report, and give it this Contol Source
property:

="Patient reprots drinking of alcohol " & [Days] & " days last week
consuming an average for " & [Drinks] & " drinks."
 
Can you also do this with code?

Like--
Me.text.caption ="Patient reports drinking of alcohol " &
[InsertHereTheFieldName] & " days last week consuming an average for " &
[AnotherFieldName] & " drinks"

And can you do this with 2 different fields?



Ofer said:
In the field control source write

="Patient reprots drinking of alcohol " & [InsertHereTheFieldName] & " days
last week consuming an average for 5 drinks"

--
\\// Live Long and Prosper \\//
BS"D


pokdbz said:
I would like to make a sentence on a report similar to the following.

Patient reprots drinking of alcohol 3 days last week consuming an average
for 5 drinks.

What I would like to know is how to get the # of days into this sentence and
what control to use? So how would I go about setting this up since every
persons # of days will be different for each person?
 
Yes, on the OnFormat section where the field is located you can write

Me.FieldName = "Patient reports drinking of alcohol " &
me.[InsertHereTheFieldName] & " days last week consuming an average for " &
Me.[AnotherFieldName] & " drinks"

--
\\// Live Long and Prosper \\//
BS"D


pokdbz said:
Can you also do this with code?

Like--
Me.text.caption ="Patient reports drinking of alcohol " &
[InsertHereTheFieldName] & " days last week consuming an average for " &
[AnotherFieldName] & " drinks"

And can you do this with 2 different fields?



Ofer said:
In the field control source write

="Patient reprots drinking of alcohol " & [InsertHereTheFieldName] & " days
last week consuming an average for 5 drinks"

--
\\// Live Long and Prosper \\//
BS"D


pokdbz said:
I would like to make a sentence on a report similar to the following.

Patient reprots drinking of alcohol 3 days last week consuming an average
for 5 drinks.

What I would like to know is how to get the # of days into this sentence and
what control to use? So how would I go about setting this up since every
persons # of days will be different for each person?
 

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


Back
Top