Avatar of Kamlesh Jain
Kamlesh JainFlag for India

asked on 

ListData refresh onClick

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
Microsoft AccessVBA

Avatar of undefined
Last Comment
Dale Fye
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

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
Avatar of Kamlesh Jain
Kamlesh Jain
Flag of India image

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Kamlesh Jain
Kamlesh Jain
Flag of India image

ASKER

Wow .. Wow ... Thank you Sir ... :) working Perfectly ..
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

glad I could help
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo