Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178

    Unanswered: Combo Box Problem

    Hi,

    In a new form, I'm testing each new object as I go along, and I have a really weird problem. In a combo box, the ONLY!!! way I can get the Click() event to fire is if I type something in the combo box and then leave it, like by <CR>, or clicking on another control. Never saw it before.

    I don't do a real Requery in the Click() event. I have VBA determining the row source value at that time. The Row Source Type is "Value List". In any case, the event doesn't even fire when I click the down arrow.

    Any comments?

    Sam

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    try beforeupdate event
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Ive had odd problems before in Access where an event doesn't seem to fire, yet the code is there. Id check that the appropriate event(s) is/are selected in the gui / form designer. (properties | events tab).. sometimes the gui doesn't recognise that code has been associated with an event.

    It may clear automatically if you do a 'compact and repair'
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Also, sometimes simply going from Properties > Events into the code window by clicking on any event and selecting Code Builder, then exiting the code window , seems to "associate" the code with the control/object.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    Quote Originally Posted by healdem
    Ive had odd problems before in Access where an event doesn't seem to fire, yet the code is there. Id check that the appropriate event(s) is/are selected in the gui / form designer. (properties | events tab).. sometimes the gui doesn't recognise that code has been associated with an event.

    It may clear automatically if you do a 'compact and repair'
    I have never had a problem with ms access its always me or the user that has the problem

    U need to look @ how msaccess handles the the events and the order they happen
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by myle
    I have never had a problem with ms access its always me or the user that has the problem

    U need to look @ how msaccess handles the the events and the order they happen
    Stephen

    Id agree that sometimes selecting the correct event to fire can be difficult (sometimes not just at first glance either), and you are right to suggest that a good knowledge of events and the sequence they fire off in is vital. It doesn't alter the fact that sometimes Access doesn't even recognise an event is their irrespective of the firing sequence. To my knowledge Access has been doing that sort of behaviour since Version 2 way back when.......

    it seems to be an inconsistency in the manner that code gets associated with the event.. its as if entering the code directly without going through the form designer (or even report designer) occasionally doesn't link correctly to the event / message despatcher. I suspect when the form runs the interpreter doesn't know there is code there, unless it the event handler has been ticked in the properties. It could be something to do with compilation errors or some other action which stops the GUI knowing there is an event created entirely in the VBA code window
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Thanks, guys.

    I tried something else, after verifying that the code was associated with the event. I transferred the code from the click() event of the combo box to the afterupdate() event of the previous control, and now everything is honky dory.

    Thanks again,

    Sam

Posting Permissions

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