Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Text box values dependant upon check box value on form

Status
Not open for further replies.

roddy17

Technical User
Jul 27, 2001
49
0
0
CA
hi
i have a report where there is a heading and then 8 labels which may be displayed under that heading. (These 8 labels are determined by using check boxes to select from 8 options on the main form.) So far i've gotten my report to only show the label(s) which is/are checked on the main form, otherwise if the option is not checked on the main form, the corresponding label is not visible.
The labels are displayed on the report in two rows with 4 labels on each row. But the report can still look messy depending on which labels are visible at the time.
E.g. If options 1 and 8 were checked on the form, then labels 1 and 8 are displayed, they are far apart and also on separate rows.
What i am hoping to do is to create a set of text boxes which are numbered 1 to 8 and have them placed on the report where my labels are now (four on the first row and four on the second). And then the first option which gets checked on the main form, has it's label (or some text) show up in the first text box, and the next one checked shows up in the second text box, and so on...
I don't know the syntax well enough, but is there some sort of loop that could be used to read from the 8 check boxes, and when it finds one which evaluates to true, it writes the corresponding value to the first text box on the report, and increments to the second text box and checks for the next check box that evaluates to true.
This is the logic that i am trying to work with so far:

x = 1
If (forms![Main Tab Form]![DeepRange] = -1) then
Me.textbox(x) = “value 1”
x = x + 1
End if

If (forms![Main Tab Form]![Range] = -1) then
Me.textbox(x) = “value 2”
x = x + 1
End if
... and so on with all eight 'If' statements.
I am thinking that a loop would be more efficient.
thanks ....... roddy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top