M
Mdmax
Hi, I have a user form with ten textboxes for medications, they create
up to
ten lines of user response data, on a seperate report document.
The bookmarks on the report list the name of the med, the dosage (in
mg),
and times per/day taken. The info from these first 3 boxes print to
one line
on the report, and then a vbcr (carriage return) takes the next
medicine
info, to the next line on the form.
Problem is, the form always generates 10 lines of data (on the report)
even
if the textboxes are blank, since I am using the following code for
each of
the 10 listings:
ActiveDocument.Bookmarks("med1").Range.Text = TextBox9.Text
ActiveDocument.Bookmarks("mg1").Range.Text = TextBox10.Text
ActiveDocument.Bookmarks("per1").Range.Text = TextBox11.Text & vbcr
ActiveDocument.Bookmarks("med2").Range.Text = TextBox12.Text
ActiveDocument.Bookmarks("mg2").Range.Text = TextBox13.Text
ActiveDocument.Bookmarks("per2").Range.Text = TextBox14.Text & vbcr
etc, etc, etc, creates data for each line on the form (up to 10)
It's probably simple, but I would like to tell the user form to "stop"
listing data (on the report), if the next series of textboxes are blank
(empty, or contain no data)?
up to
ten lines of user response data, on a seperate report document.
The bookmarks on the report list the name of the med, the dosage (in
mg),
and times per/day taken. The info from these first 3 boxes print to
one line
on the report, and then a vbcr (carriage return) takes the next
medicine
info, to the next line on the form.
Problem is, the form always generates 10 lines of data (on the report)
even
if the textboxes are blank, since I am using the following code for
each of
the 10 listings:
ActiveDocument.Bookmarks("med1").Range.Text = TextBox9.Text
ActiveDocument.Bookmarks("mg1").Range.Text = TextBox10.Text
ActiveDocument.Bookmarks("per1").Range.Text = TextBox11.Text & vbcr
ActiveDocument.Bookmarks("med2").Range.Text = TextBox12.Text
ActiveDocument.Bookmarks("mg2").Range.Text = TextBox13.Text
ActiveDocument.Bookmarks("per2").Range.Text = TextBox14.Text & vbcr
etc, etc, etc, creates data for each line on the form (up to 10)
It's probably simple, but I would like to tell the user form to "stop"
listing data (on the report), if the next series of textboxes are blank
(empty, or contain no data)?