Results 1 to 3 of 3

Thread: Requery

  1. #1
    Join Date
    Oct 2005
    Posts
    87

    Unanswered: Requery

    Hello,

    I have a form, where one client field is bound (combobox with rowsource sql) and several other fields are unbound (like address,zip,etc). And their source is set to combo.column(1) , etc ..

    Now when i select my client, other fields won't update immediately...only if i go to next record and then back to this one, or close form and then open again...

    I write in vba, me.requery on the afterupdate event, but after this, when i select client, my whole form refreshes and goes instantly to the first record. This is ok if i select client in first record, but if i select him in second, third,etc form always goes to first record.


    Any solutions to this problem?

    Thank you

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    instead force the population of you unbound controls using the combo boxes on click / on change events

    I'd also consider changing the recordsource for your combo. if you are poplating the combo with the contact details then potetnailly you have a large memory user whch could seriously affect your applcations, and network performance. In a multi user environmnet you are pulling information valid at the time the combo was first populated - it will not relfect changes going on in the system

    consider instead suing a dlookup, or open a recordset when the form opens, on chnage of combo redefien the recordset to select the precise details you require, remembering to close the recordset when the form closes.
    HTH
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2005
    Posts
    87
    Quote Originally Posted by healdem
    instead force the population of you unbound controls using the combo boxes on click / on change events
    You mean to change code, from afterupdate to onclick/onchange for combobox?

    I'd also consider changing the recordsource for your combo. if you are poplating the combo with the contact details then potetnailly you have a large memory user whch could seriously affect your applcations, and network performance. In a multi user environmnet you are pulling information valid at the time the combo was first populated - it will not relfect changes going on in the system

    consider instead suing a dlookup, or open a recordset when the form opens, on chnage of combo redefien the recordset to select the precise details you require, remembering to close the recordset when the form closes.
    HTH

    Maybe you have some example for dlookup use?

    Thanks
    Last edited by YZF; 01-19-06 at 06:22.

Posting Permissions

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