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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically modify row source for combo box in report?

Status
Not open for further replies.

VictoryHighway

Technical User
Mar 4, 2004
115
US
Hello,
I'm trying to create a report that needs to dynamically change the row source of a combo box. In the Detail_format section of the VBA code, i put in the statement:

--
me.Combo38.rowsource = "SELECT [" & txtDeptAbbr & "Stages].[StagesID], [" & txtDeptAbbr & "Stages].[Stages] FROM " & txtDeptAbbr & "Stages;"
--

However, when I try to preview the report, Access gives me an error:

Run-time error '2191': You can't set the Row Source property after printing has started.

Is there any way to do this in a report? If not, I'll have to make a change to they layout of my tables to compensate.

Thanks for any help you can offer.

--Geoffrey
 
The message is correct. There are lots of methods for displaying related records and a combo box is only one. You could use an unbound text box and use code or some sql in your report's record source.

You haven't provided nearly enough information for someone to suggest a solution.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Well, let me try something else here, and If I run into trouble doing it another way, I'll reply here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top