View Single Post
  #4  
Old May 29th, 2010, 12:27 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default PLEASE HELP: Refresh columns displayed in a report from a quer

sam wrote:
In the following code you gave:

With Forms!theform
Me.txtSelect1.ControlSource = .txtSelect1
. . .
End With

Me.txtSelect1.ControlSource is refering to the column header in the report?


Me.txtSelect1 is the name of the report text box that you
want to bind to the field a user specified in the form
text/combo box, also named txtSelect1. The ControlSource
property is where you need to put the name of the field with
the values yo want the text box to display.

Since I have no idea what kind of headers you are using nor
what you want them to display, I did not try to comment on
that.

and Forms!theform.txtSelect1 is the field from the form?


Yes, that is the form text box where users specify the name
of a field that you put in the report's record source query.

If I have the right understanding, once I do the above code: then I open the
report with: DoCmd.OpenReport "Student Report", acViewReport, , strWhere1 &
strWhere2


That may or may not be correct depending on what you are
putting in the strWhere strings. The commas look to be
wrong to me. The end result should look something like:

DoCmd.OpenReport "Student Report", acViewPreview, ,
strWhereAll

with strWhereAll containing something along these lines:
thisnumberfield=123 And thattextfield="ABC"

--
Marsh
MVP [MS Access]