470,560 Members | 1,335 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,560 developers. It's quick & easy.

Requery a List Box in a Subform "On Record Navigation"

Hi everyone,

First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a firm name in a combo box above the list box. The listbox and the combo box join on firm name. The listbox records what address was selected in the address table by the way of an address id number. I set up a macro to requery the listbox when you select a new firm name in the combo box. The code for the requery is as follows:

Private Sub firm_name_AfterUpdate()

End Sub

My problem is that when the user moves to a new record in the subform, the address information does not refresh; you have to click on the new firm name before the address information will update itself. I am worried that this in one more thing a data entry person will have to worry about.

I am wondering if there is a code that would requery my listbox whenever you move to a new record in my subform, essentially an "On Record Navigation" requery option. I have tried nearly all the macro requery possibilities with no luck. Ideally, a user would be able to go back to previous records and see what address he or she had selected, however I would be happy even if it just requeried to blank.

Any suggestions? Thank you for your help,

Dec 7 '06 #1
6 7602
Hey again,

I think I figured it out, but if anyone has any new ideas, let me know. Hope to contribute in the future, thank you,

Dec 7 '06 #2
I suspect that if you put code into the "On Current" field of your subform, it will have the desired effect.
Dec 7 '06 #3
Yeah, that was it. Thanks for your reply.
Dec 7 '06 #4
Happy to help
Dec 7 '06 #5
Hi there!

I've got a similar piece of coding going on but having the same problem.

I have 3 tables and at the moment I'm focussing on two of them. One full of Suppliers, another with their Product Codes and Descriptions. These are joined by Supplier name.

My form has a combo box which lets you select your desired supplier. This then enables a list box once selected which shows you all their Product Codes and Descriptions. Above these I have two text boxes. I would like it that once a line in the list box is selected, the relevant Code and Description for that record is displayed in the text boxes for editing purposes.

How can I achieve this?

Thanks for any help!

Apr 13 '07 #6
Also, another thing I would like to know is how I could directly edit the record by typing into the listbox itself.

My initial idea was to just have a listbox which you could directly edit and add lines to for new records.

I couldn't figure it out, hence having to add in text boxes for adding/editing records.
Apr 13 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Jim | last post: by
3 posts views Thread by Lee-Anne Waters via AccessMonster.com | last post: by
3 posts views Thread by =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post: by
25 posts views Thread by tekctrl | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.