Hiding Report

  • Thread starter Thread starter van
  • Start date Start date
V

van

Hi

I have a form which contains a combo box, based on user selection from this,
i wish to place a block of colour in a field of a report, whih will be
produced from the form. However, when I try to execute this code, I am told
that the report is misspelt or not open. I dont want this report open at
this stage, so is there anyway of opening it in the background, or hiding it
at this stage?
 
Van,

I think a better solution would be to put code in the open event of the
report that would capture the value of the combo box and make the color of
the text box on the report from that.

something like:

Select case [forms]![MyForm]![MyComboBox]
case is = 1
'Set the color here for this case
case is = 2
'Set the color here for this case
case is = 3
'Set the color here for this case
End Select
 
Van,

Got an error first time I tried, so please pardon if this is a repeat.
I would suggest putting code in the Open event of the report. Something like:

Select Case [forms]![MyForm]![MyComboBox]
Case 1
'Set the color for this case
Case 2
'Set the color for this case
Case 3
'Set the color for this case
End Select
 
Thanks Klatuu, I think this is a better suggestion.

However, this piece of code is lifting the first value from combo box off
the first row, and applying the case statement to all rows on the report
according to the value in the first row. How can I get this to apply to
each row individually? Is this because the form I am pulling the info from
is based on continuous view?!?!



Klatuu said:
Van,

I think a better solution would be to put code in the open event of the
report that would capture the value of the combo box and make the color of
the text box on the report from that.

something like:

Select case [forms]![MyForm]![MyComboBox]
case is = 1
'Set the color here for this case
case is = 2
'Set the color here for this case
case is = 3
'Set the color here for this case
End Select

van said:
Hi

I have a form which contains a combo box, based on user selection from this,
i wish to place a block of colour in a field of a report, whih will be
produced from the form. However, when I try to execute this code, I am told
that the report is misspelt or not open. I dont want this report open at
this stage, so is there anyway of opening it in the background, or hiding it
at this stage?
 
Sorry, van, I did not read closely enough. I see that it is in the report
that you want this to happen, not the form. In that case, put the logic in
the On Format event of the report.

van said:
Thanks Klatuu, I think this is a better suggestion.

However, this piece of code is lifting the first value from combo box off
the first row, and applying the case statement to all rows on the report
according to the value in the first row. How can I get this to apply to
each row individually? Is this because the form I am pulling the info from
is based on continuous view?!?!



Klatuu said:
Van,

I think a better solution would be to put code in the open event of the
report that would capture the value of the combo box and make the color of
the text box on the report from that.

something like:

Select case [forms]![MyForm]![MyComboBox]
case is = 1
'Set the color here for this case
case is = 2
'Set the color here for this case
case is = 3
'Set the color here for this case
End Select

van said:
Hi

I have a form which contains a combo box, based on user selection from this,
i wish to place a block of colour in a field of a report, whih will be
produced from the form. However, when I try to execute this code, I am told
that the report is misspelt or not open. I dont want this report open at
this stage, so is there anyway of opening it in the background, or hiding it
at this stage?
 
Back
Top