Avatar of caddsman
Flag for United States of America asked on

acViewDesign and Multi-User Database

Hello Experts,

I have a report with twenty or so textboxes with labels that I'm dynamically setting the controlsource properties and the controlsource to in an effort to hide fields that do not apply to that particular record. this is done by opening a sub-report in design view and hidden, modify the recordsources, then opening the report. The problem is that this locks any other user out of the database. I have found that this cannot be done when the report is opening so I need assistance with another means of achieving this goal. Thanks.
Microsoft Access

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Scott McDaniel (EE MVE )

Pete is, of course, correct. However, you don't need to open the report in Design view to set the report's Recordsource. You can use the Report's Open event to "look" for a recordsource, perhaps in an open form's textbox or something ... for eg:

Sub Report_Open()

  Me.Recordsource = Forms!frmSomeForm.txtReportrecordSource

End Sub

And on frmSomeForm, in a textbox named txtReportRecordSource:

SELECT * FROM SomeTable WHERE AField=Some_Value


Thanks for the comments. I'm not setting the report recordsource but rather the text box recordsources dynamically. Lets say I have twenty text boxes on a form but only every other text box is being used. Per the requirements, they don't want to see all of those text boxes, only the ones being used. So, I created a loop, set the record sources of the text boxes so that the ones being used are side-by-side, and then, I hide the rest of them. I guess the easiest thing to do is distribute the front end to each user and call it a day. Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.