Very novice question but I have a report that has a couple of columns including usernames. I also have a form where a user can select a user name in a combo box and the report will open up only showing records that pertain to that user. Is there a way that I can put a text box on the report that is populated based on what was selected in the combox box of the form which is used to open the report? Note I'm closing the form immediately after opening the report.
Best How To :
Since your Access version is 2007 or later, you can use a
TempVar to pass the combo box value to the Control Source of your report's text box.
For example, with this as the Control Source for Username_txt, the following click event procedure will ensure the correct value is displayed in that text box:
Private Sub reportbyuser_bt_Click()
TempVars("user_name") = Me.Filteruser_cb.Value
DoCmd.OpenReport "Report by user", acViewReport
DoCmd.Close acForm, Me.Name
You can adapt that to use your
Filteruser_cb.Column(n) instead of