Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Requery Once More (A2K)

    It's the old update the combo box trick again.
    When I close one form, I want to requery the combo box in another form, and obviously, my command of VBA is tenuous.
    Here is what I'm trying to do OnClose

    Me.Form![frm GPE Corporations].[txtCorporationType].Requery

    That is from the form that I'm closing, I want to Requery the Combo Box "txtCorporationType" in the form "frm GPE Corporations". I think I'm close, but.....

    Would appreciate any help. Thanks in advance.
    Cheers,
    Andy

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

    Re: Requery Once More (A2K)

    Me refers to the form executing the code, i.e. the form you are closing. You can't refer to another form this way. Try this instead:

    Forms![frm GPE Corporations]![txtCorporationType].Requery

    Note the use of Forms instead of Me.Form.

    Minor quibble: the prefix txt usually indicates a text box, for combo boxes the prefix cbo or cbx is used. This is not essential, however.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Requery Once More (A2K)

    I could picture you as a gunfighter in the Old West because you are so quick on the draw. As always, you are correct with both your solution and also your suggestion re the correct naming of the combo box. I shall cbo all those boxes where applicable. Thanks again,

    Andy
    Cheers,
    Andy

Posting Permissions

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