Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Posts
    10

    Unanswered: Any way to requery on a data entry form?

    First field on the form is to select a particular 'sporting event'. Second field on the form is to select a customer.

    The second field is a combo box tied to a query that only selects customers that aren't already engaged in a sporting event during the same time frame. The query works fine.

    If the sporting event combo is changed after the data entry form is saved (say the event was chosen incorrectly the first time), the customer query combo will not update to the reflect customers that should be available for a different sporting event. I have a subform running the same customer query (to include additional customers) which does change after a refresh. Requery will not work on the customer combo box either.

    The only way I can get it to refresh is to delete, and start a new data entry. This is not acceptable.

    Thanks in advance for any words of advice.

  2. #2
    Join Date
    Dec 2006
    Posts
    10
    Maybe there is a different way to filter the customer selection?

    The query works great though, which is why I'm annoyed that I can't implement it properly here.

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Requery will not work on the customer combo box either.
    That's strange. If you have the Requery command for combox2 in the AfterUpdate event of combobox1, re-selecting a new sports event should trigger that requery...

    Sam

  4. #4
    Join Date
    Dec 2006
    Posts
    10
    Here's the sequence of events... (I'm using 'event' to signify sporting event)

    1. Open form in data entry mode
    2. Select an 'event' (first foreign key)
    3. The customer combo box is populated with the query results based on the 'event' selection
    4. Customer detail is selected from the combo box.
    5. Form can now be saved.

    By this point, I should be able to change the 'event' selection, refresh the form, and the customer combo *should* show me the query results based on the different 'event'. This simply doesn't happen.

    Requery just throws up an error...

    http://homepage.ntlworld.com/shuffle...es/warning.png

    'The command or action 'Requery' isn't available now.'

    I'm not in a read only database, and the combo box is selected and on the main form.

  5. #5
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Do you have both a Control Source and a Row Source specified for the customer combo? If so, lose the Control Source and try it again. Please make sure the Customer combo Row Source Type property is set to "Table/Query" and NOT to "Value List." Also, please copy and paste the code you have in the AfterUpdate event of the Sports event combo; and please copy and paste the customer combo Row Source SQL statement. These should give us a better idea what's happening.

    By the way, what version of Access are you running, and what version is the database?

    Sam

  6. #6
    Join Date
    Dec 2006
    Posts
    10
    PEBCAK error in this case.

    I was running a macro from the macro page, rather than from a button on the form (for testing purposes). I've hooked up a button on the form with a requery macro, and this is working fine.

    Dunno what it is about posting on a forum for help... I always end up finding the mistake myself. Is it similar to thinking out loud, or maybe it's just my aptness for making myself look like an idiot? One way or another, it helps.

    Thanks for throwing some thoughts in this direction

Posting Permissions

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