We help IT Professionals succeed at work.

ListData refresh onClick

Kamlesh Jain
Kamlesh Jain asked
on
112 Views
Last Modified: 2017-04-27
Hello,
I am using split Form. Presently, on clicking a single filed (Supplier in this example), three list boxes get updated.

Private Sub Supplier_Click()
Call Me.List164.Requery
Call Me.listExtension.Requery
Call Me.List169.Requery

End Sub

Private Sub Supplier_GotFocus()
Call Me.List164.Requery
Call Me.listExtension.Requery
Call Me.List169.Requery

End Sub

IS it possible that these three list shall get refreshed upon clicking / focusing on ANY FIELD ?
Thanks
Comment
Watch Question

Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010

Commented:
You could create a function, something like:
Private Function fnRequeryLists

    Call Me.List164.Requery
    Call Me.listExtension.Requery
    Call Me.List169.Requery

End Function

Open in new window

Then select all of the controls you want to do this from, open the Properties dialog and go to the Events tab, then type:

= fnRequeryLists()

into the GotFocus event.

HOWEVER, I cannot for the life of me figure out why you would want to requery these lists in the GotFocus of anything.  Assuming that those lists have RowSource values which refer to controls on the form, you would normally do this in the AfterUpdate event of the controls which would affect the values displayed in those lists.

FURTHERMORE, if those lists are cascading, they depend on the value in another one of the lists, then doing this would requery those lists and the cascading aspect would fail.

It might be better if you could take a screen shot of your form in design view and explain what you are trying to accomplish.

HTH
Dale
Kamlesh JainManager

Author

Commented:
Sir. Thanks for the reply. Will try Function.
Meanwhile, would like to clarify :

1. Screen shot is attached
2. MY purpose : On clicking a Purchase Record in datasheet,   i can take a glance its Sale, its lifting qty etc.
3. This form is not used for Data Entry , but i am using it for muliple querry / calling of records only.

Best Regards,
Kamlesh Jain
2017-04-27.png
Owner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Kamlesh JainManager

Author

Commented:
Wow .. Wow ... Thank you Sir ... :) working Perfectly ..
Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010

Commented:
glad I could help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.