Re: Listbox Rowsource

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for the response.

I wanted to use the list box because I like the way it displays the data. I
have a form where users enter lot numbers for defective materials. They scan
in as many lot numbers as they need to -- I display what they scan in on a
list box on the form.

I store all the lot number in a string to one field in my table. When I
need to display the lot numbers again on the form I set the rowsource
property of the form's list box to the string I stored and it displays just
fine.

I was hoping to do the same on the report but realize that this not
possible, however I do find it annoying that the list box control is
available for reports but you can't really control it. Fredg explains why in
the other response to my post.

I realize that I'll have to look for another approach.

Thanks again for your help.


--
Scott S


"Rick Brandt" wrote:

ScottS wrote:
Is it possible to change the rowsource for a listbox on a report
using VBA?

Pretty unusual to use a listBox in a report, but other than that you shoudl be
able to do it.

Me.ListBoxName.Rowsource = "SomeNewRowsource"

There is a good chance that you will not be able to do this in any event other
than report Open event though. You would have to test any others. Many things
like this that can be done on a form can only be done on a report in the open
event. Once the printing process starts they become read only.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com



.



Relevant Pages

  • Re: PLEASE HELP....Properties and Methods
    ... I tried changing the control name of RecipeName on the report and I am ... You have to substitute the NAME property of your control in here... ... The properties window changes as you ...
    (microsoft.public.access.reports)
  • RE: Emailers and Add-ons
    ... So 222 333 444 etc are just to show you where to put the name of the control. ... The title of the report is rptAuditOnLine ... Is there a way that a macro can be written to ... The macro opens a form. ...
    (microsoft.public.access.gettingstarted)
  • RE: *REPOST* If then Else Statment in Report
    ... "Duane Hookom" wrote: ... when a main report doesn't return records. ... Earlier as we found I was confused about the name of the control ... which is the name of the subreport as seen in the database window. ...
    (microsoft.public.access.reports)
  • Re: RTF2 ActiveX control stretches text in reports
    ... Report Abuse ... The issue is that the control in the detail section is not formatting ... third seems to have an issue with the font pitch as "I am ge ttin g ou ... Stephen Lebans Feb 5, 12:39 am show options ...
    (microsoft.public.access.reports)
  • RE: Access Database Reports
    ... If it is asking for a parmeter, then it can't find the control on the form. ... Dave Hargis, Microsoft Access MVP ... Thanks, Steve ... I don't know how you are opening your report, but I will assume you are ...
    (microsoft.public.access.reports)