Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Row Source syntax (2000)

    I have the following setup

    tblRESIDENTS
    ResID
    OnAlert (Yes/No)
    ...

    tblALERT_RECORDS
    ResID (cbo) with RowSource: SELECT [tblRESIDENTS].[ResID], [tblRESIDENTS]![ResLastName] & ", " & [tblRESIDENTS]![ResFirstName] & " " & [tblRESIDENTS]![MI] FROM tblRESIDENTS WHERE [tblRESIDENTS]![OnAlert]=Yes;
    ...

    qryALERT_RECORDS
    ResID
    ...


    frmALERT_RECORDS
    ResID (cbo)
    ...
    AllowAdditions = False

    cmdADD_NEW_RESIDENT_TO_LIST with the following code:
    <font color=blue> ...
    Me.AllowAdditions = True
    Me.ResID.RowSource= SELECT [tblRESIDENTS].[ResID], [tblRESIDENTS]![ResLastName] & ", " & [tblRESIDENTS]![ResFirstName] & " " & [tblRESIDENTS]![MI] FROM tblRESIDENTS WHERE [tblRESIDENTS]![OnAlert]=No; </font color=blue> <font color=448800>'Get list of residents who are NOT currently On-Alert</font color=448800>
    <font color=blue>Me.Requery
    ...</font color=blue>

    Since the form is based on a qry listing residents who are already On-Alert, when I want to Place a new resident On-Alert status I must change the list items in the ResID cbo. Here's where I need help. The Me.ResID.RowSource code above doesn't work. Any Help??

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Row Source syntax (2000)

    A row source is a string so try:

    Me.ResID.RowSource= "SELECT [tblRESIDENTS].[ResID], [tblRESIDENTS]![ResLastName] & ', ' & [tblRESIDENTS]![ResFirstName] & ' ' & [tblRESIDENTS]![MI] FROM tblRESIDENTS WHERE [tblRESIDENTS]![OnAlert]=No" 'Get list of residents who are NOT currently On-Alert

    i.e. Enclose the whole thing in double quotes, then replace the embedded double quotes with single quotes.
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Row Source syntax (2000)

    Thanks John That worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •