Tags: access, alcohol, averagefor, consuming, database, drinking, following, insert, microsoft, mysql, oracle, patient, report, reprots, sentence, similar, sql, value

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

On Database » Microsoft Access

3,435 words with 4 Comments; publish: Fri, 06 Jun 2008 15:23:00 GMT; (25062.99, « »)

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?

All Comments

Leave a comment...

  • 4 Comments
    • 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" wrote:

      > 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?

      #1; Fri, 06 Jun 2008 15:25:00 GMT
    • 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."

      Allen Browne - Microsoft MVP. Perth, Western Australia.

      Tips for Access users - http://allenbrowne.com/tips.html

      Reply to group, rather than allenbrowne at mvps dot org.

      "pokdbz" <pokdbz.ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:C9E91D45-5109-4DF8-A1F9-DD8A11141D4B.ms-access.todaysummary.com.microsoft.com...

      >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?

      #2; Fri, 06 Jun 2008 15:26:00 GMT
    • 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" wrote:

      [vbcol=seagreen]

      > 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" wrote:

      #3; Fri, 06 Jun 2008 15:27:00 GMT
    • 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" wrote:

      [vbcol=seagreen]

      > 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" wrote:

      #4; Fri, 06 Jun 2008 15:28:00 GMT