Link to home
Create AccountLog in
Avatar of caddsman
caddsmanFlag 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.
Avatar of peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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

Avatar of caddsman


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