Syntax to change Control Source for a Report Field

K

Kahuna

Hi Folks - as usual - pulling my hair out!!

I have a report based on a query, and I am trying to change the control
source of a specific field on the report to one or other of the query result
fields, dependant on other criteria. Been 'round the houses' numerous times
now with this, but keep getting the error that the 'Field' cant be found.

Using Select Case here's where I am at (its in OnOpen):
'***************************
Dim SelectedScenario As String

SelectedScenario = DLookup("[ss_selected_scenario]", "system_settings",
"[ss_selected_scenario] = True")

Select Case SelectedScenario

Case 1

Me!ex_calculation_factor = [bs_extent_used] ' Here's the error

End Select
'***************************
Tried numerous syntax to refer to the field and get either and Object error,
or the mentioned 'cant find the field' error.

Tried this in OnFormat too but the error said I couldn't change the record
source once the report was open!

Suggestions appreciated.
 
K

Kahuna

Thanks folk got it ...

Me!ex_calculation_factor.ControlSource = "bs_extent_used"

Trial and error - takes time but works wonders!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top