View Full Version : Automatically generating a report title


swills
11-16-2006, 06:44 AM
Hi all,

I have a form when i start my db and depending on the options selected in the combo boxes on this form, a chart is shown on a report. Is it possible to include the selections made in these combo boxes in the report title?

if so, how would i go about this, thanks in advance

gemma-the-husky
11-16-2006, 07:43 AM
put labels in the report for the details, and in the reportopen event

do

label1.caption = "myformsreference etc"


its the caption property thats the thing.

swills
11-16-2006, 07:53 AM
sorry im a bit of a noob sometimes.

basically have a diff label for each combo box?

then in the reportopen event

label.caption = cboRelease

is that what you mean?

also the reportopen event where should that be? in the report class object?

thanks for ur help

gemma-the-husky
11-16-2006, 09:23 AM
get the report open in design mode. click the properties icon (oor any other method) in events click the open event, to get to the code window,

now here, you are executing commands as part of the forms open event, so you can set (by code) unbound text boxes in this report, by reference to any external requirement. eg a constant value, or as in your case a detail taken form another form. but you have to refer to the form in a particular syntax

mylabel.caption = forms!anyparticularform!cboRelease

(but this syntax may be not right - i always have to check it in help!

swills
11-17-2006, 01:28 AM
Thanks alot Gemma, ive got it working, really appreciate your help