[AccessD] Add All to List

Charlotte Foust cfoust at infostatsystems.com
Thu Mar 4 11:02:17 CST 2004


You have to match datatypes in the union.  If NCSAID is numeric, then
you have to use a number, like -1 for instance, instead of the "*".  If
NCSANo is numeric, you need to use something like CStr(tbl_NCSA.NCSANo)
in order to accommodate the "All" value.

Charlotte Foust

-----Original Message-----
From: Hollis,Virginia [mailto:HollisVJ at pgdp.usec.com] 
Sent: Thursday, March 04, 2004 5:29 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Add All to List


Still struggling...

On the recordsource for the combo box I put:
SELECT tbl_NCSA.NCSAID, tbl_NCSA.NCSANo FROM tbl_NCSA; UNION SELECT "*",
"All" FROM tbl_NCSA; This gets me the word ALL in the list.

Then on the AfterUpdate of cboNCSANo, I put (this gives me a type
mismatch when I select All):
  If Me![cboNCSANo] = "All" Then
      DoCmd.ShowAllRecords
    Else
      DoCmd.ApplyFilter , "[NCSAID] = " & str(Me![cboNCSANo])
  End If

Va.

-----Original Message-----
From: William Hindman [mailto:wdhindman at bellsouth.net]
Sent: Wednesday, March 03, 2004 4:07 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Add All to List


...the easiest way is to "if" the combo's after update event :)

After Update Event cboCustomer
  If Me![cboCustomer] = "<All>" Then
      DoCmd ShowAllRecords
    Else
      DoCmd ApplyFilter , "[State] = Forms![cboCustomer]![cboCustomer]"
  End If

William Hindman "My idea of an agreeable person is a person who agrees
with me." Disraeli

----- Original Message ----- 
From: "Hollis,Virginia" <HollisVJ at pgdp.usec.com>
To: "'Access Developers discussion and problem solving'"
<accessd at databaseadvisors.com>
Sent: Wednesday, March 03, 2004 4:29 PM
Subject: RE: [AccessD] Add All to List


> I don't know what I am doing wrong.... The all shows at the top of the
list,
> but All the records do not show on the subform. The combobox is still 
> showing the first record when it opens and the subform is filtered for
that
> record.
>
> What makes the All part of "ALL" in the combo box work?
>
> Virginia
>
> -----Original Message-----
> From: William Hindman [mailto:wdhindman at bellsouth.net]
> Sent: Wednesday, March 03, 2004 8:09 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Add All to List
>
>
> Virginia
>
> ...use a UNION SELECT in the combo record source to add an ALL.
>
> ...example:
>
> SELECT DISTINCTROW Customers.Company, Customers.[Customer Number] FROM

> Customers UNION SELECT "<ALL>","" FROM Customers ORDER BY
Customers.Company;
>
> William Hindman "My idea of an agreeable person is a person who agrees
with
> me." Disraeli
>
> ----- Original Message -----
> From: "Hollis,Virginia" <HollisVJ at pgdp.usec.com>
> To: <accessd at databaseadvisors.com>
> Sent: Wednesday, March 03, 2004 8:45 AM
> Subject: [AccessD] Add All to List
>
>
> > How do you add All to List? This form contains 2 combo boxes on a 
> > main
> form.
> > Selecting data shows data on a subform for the related combo box
choices.
> >
> > I need to either have an All in the combo boxes or when the form 
> > opens,
I
> > would like them to be blank.
> >
> >  I tried this code in the On Open of the main form, but it still 
> > opens
to
> > the first record with entries in both combo boxes.
> >
> >     With Me
> >         .cboNCSANo = ""
> >         .cboProcedure = ""
> >     End With
> >
> > Virginia
> > --
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list