Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    coordinate form and list box (Access 2000)

    Is there any way to coordinate the list box with the current number in the form?
    I have a form called frmClients, with a sourc tablClients, and a list box called ListOffers with the following fields:

    Clientid, offerid,offedate
    or the Row source is :

    SELECT TblClients.ClientID, TblOffers.offerid, TblOffers.offerdate
    FROM TblClients INNER JOIN TblOffers ON TblClients.ClientID = TblOffers.Clientid;

    My idea is to use in the On current event a code that coordinates the Clientid of the form with the clientid of the list box as
    Me![Clientid] = Me![list].
    This is not enough since i receive the message you cant assign a value to this subject. I need to findd the clientid of the list box to be equal to the clientid in the form
    How can i do it ?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: coordinate form and list box (Access 2000)

    How are you using the listbox? if you already have a record visible, what's the purpose of trying to set the value of the listbox? Is the listbox bound or unbound?
    Charlotte

  3. #3
    Lounger
    Join Date
    Aug 2002
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: coordinate form and list box (Access 2000)

    the list box is bound to a query and i have quoted it as row source above.The first field,which is hidden, is clientid, and i want
    in the on current event to show all the offers the a client has issued. The purpose of the list box is see for each client the offers that he has

    regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: coordinate form and list box (Access 2000)

    1. Set the Row Source of the list box to

    SELECT ClientID, OfferID, OfferDate FROM TblClients WHERE ClientID = [Forms]![FormName]![ClientID]

    where FormName is the name of your form.

    2. Put code in the On Current event of the form to requery the combo box when the user moves to another record:

    Private Sub Form_Current()
    Me.ListOffers.Requery
    End Sub

  5. #5
    Lounger
    Join Date
    Aug 2002
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: coordinate form and list box (Access 2000)

    Thank you for the help

Posting Permissions

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