RE: Allowing form combo box to show all records



Hi Ofer.

Thank you for your help. However, your suggested solution didn't work for
me. It could be that I did not implement your solution correctly. I was not
sure whether your solution was an actual SQL statement, or whether it was a
Visual Basic code framework. I tried the statements in the row source for the
combo box (I made sure I used the correct query name and field name). I'm not
proficient enough in VB, so I was a bit baffled when attempting to construct
a VB equivalent.

Any suggestions?


Dirk
Winnipeg, Canada


"Ofer" wrote:

> One way that you could use is, when no project selected then display all
> records
>
> Select * From ProjectTable Where ProjectField Like
> NZ(Forms![FormName]![ComboName],"*")
>
> Or
> Select * From ProjectTable Where ProjectField Like
> IIf(Forms![FormName]![ComboName] is null or Forms![FormName]![ComboName] =
> "","*",Forms![FormName]![ComboName])
>
> --
> I hope that helped
> Good luck
>
>
> "rupertsland" wrote:
>
> > Greetings.
> >
> > I am building a report tracking database using Access 2003.
> >
> > I have a main form that's tied to an underlying query that displays a list
> > of Projects. On the main form I have a subform that displays a list of
> > published reports (the subform is tied to an underlying query that displays a
> > list of reports - each report record has a foreign key [PROJ_ID] that allows
> > me to associate a report with a project). I added a combo box using the combo
> > box wizard to allow me to filter out reports associated with a project and
> > display the filtered result in the subform.
> >
> > What I would like to do is to provide an option to clear the filter and
> > display all records in the subform. The combo box is only able to display a
> > list of projects, but I am unable to find a way to provide a "Show all
> > records" option in the combo box.
> >
> > Is there a way to do this? The VB code I'm using was generated by the
> > wizard, and is as follows:
> >
> > -----
> > Private Sub Combo62_AfterUpdate()
> > ' Find the record that matches the control.
> > Dim rs As Object
> >
> > Set rs = Me.Recordset.Clone
> > rs.FindFirst "[PROJ_ID] = " & Str(Nz(Me![Combo62]))
> > If Not rs.EOF Then Me.Bookmark = rs.Bookmark
> >
> >
> > End Sub
> > -----
> >
> > If the above code can not be changed, is there an alternative workaround?
> > Any help would welcome.
> >
> > Dirk Schmid
> > Winnipeg, Canada
> >
.



Relevant Pages

  • Re: Show all records through combo box
    ... "Each company supplies a variety of parts, so you could have a Company table ... Parts subform. ... explain how you want that system to show up on a report. ... Then i would like to option to filter those parts depending on the ...
    (microsoft.public.access.forms)
  • Syntax Problem in accessing a control on a form - Access97
    ... I have a main form which includes a subform. ... the subform to display any one of several forms, ... One of the forms to be displayed (frmToDo) is a continuous form with several ... When I tried to produce and run a report, it became evident that the sorting ...
    (microsoft.public.access.formscoding)
  • Re: multiple subform images per main search form record
    ... Thanks for pointing me to the links to the tutorial and to the report code. ... I have added the textbox controls ImageID1 through ImageID5 on the main ... In the subform itself, you can process a double-click event on each ... enlarged image and filter it analgous to how you filter the popup form ...
    (microsoft.public.access.formscoding)
  • Re: Read-only user & subforms
    ... In the case of the report, you displayed that message on the main report. ... subform clears and loads its records, and it is not in the desired place. ... >> Read-only permission gives you condition b. ... >> able to get the values and display these correctly either. ...
    (microsoft.public.access.forms)
  • Re: Subform
    ... For an efficient solution, see: ... Find as you type - Filter forms with each keystroke ... Currently subform will display data if ONLY the 3textboxes are input ...
    (microsoft.public.access.forms)