Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Posts
    3

    Red face Unanswered: ComboBox list update

    Hello,

    I'm a quite new Microsoft Access user and I'm developing a small application.
    I have a problem with a Combobox that I'm sure you have already solved many times.
    I have a form "Form1" in which there is a ComboBox for selecting existing Clients and in this form there is also a cmdbotton "addnew" to open an other form "Form2" in which to enter a new client.
    All works fine but when I come back to Form1 I see the new record in the ComboBox list but when I choose the infromation displayed are not related to it but to the first client in the DB .

    Please can you help me ?
    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    after you have added a new customer then issue a requery command to rebuild the combo box.
    you could do that in the form with the combo box (add a button adjacent to the combo, place some code behind the button to refresh the combo eg
    combobox1.refresh
    could be combobox1.requery
    where combobox1 is the name of the combo box

    if you are more adventurous you could push the values from the new customer form.
    you'd need to check the other form was open and the in the forms on after upodate event force a refresh/requery of the combo box in the other form

    form1.combobox1.requery

    where form1 is the name of the form and so on.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2011
    Posts
    3
    Hello Healdem,
    thanks for your prompt reply but I have now a new probelm. Now I'm getting Run Time errr 424: Objetc Required. How can ) solve it

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    correct your code to so that you refer to an object that Access knows about.
    either you've misstyped an object name or used one that doesn't exist.

    as you haven't provided your code
    you haven't shown which line the code craps out on its a little hard to be more helpful

    In the past I have been accused of being psychotic, but never psychic.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    May 2011
    Posts
    3

    form with no data coming from a lstbox

    Hi Healdem

    I've have two forms "ListaClienti" and "DettagliCliente". In the first one
    there is lstBox with the list of customers. When I choose one of them and I push the cmdbottom the second form is displyed with no data.
    The IDClienti key is numeric (Autonumber) Clienti is the table storing the data
    Here the code attached to the cmdbottom:

    Private Sub Dettagli_Click()
    'Find a selected record, then close the search dialog box

    DoCmd.OpenForm "DettagliCliente", , , [Clienti.IDCliente] = Me.lstSearch.Column(0)

    Exit Sub

    'Close the dialog box
    DoCmd.Close acForm, "ListaClienti"

    Exit_Dettagli_Click:
    Exit Sub

    Error_Description:
    If err.Number = 2501 Then
    MsgBox err.Description
    Resume Exit_Dettagli_Click
    Else
    MsgBox err.Description
    Resume Exit_Dettagli_Click
    End If


    End Sub
    CAn you help me ? Tks

Posting Permissions

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