By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

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

P: 3
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()
Forms!Contract!Contract_Subs.Form!List25.Requery


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,

Marko
Dec 7 '06 #1
Share this Question
Share on Google+
6 Replies


P: 3
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,

Marko
Dec 7 '06 #2

P: 33
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

P: 3
Yeah, that was it. Thanks for your reply.
Dec 7 '06 #4

P: 33
Happy to help
Dec 7 '06 #5

P: 56
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!

Si
Apr 13 '07 #6

P: 56
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.