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

having trouble on form_open: set value of two listboxes

P: 65
hello,

i have a button that opens a form and sets two list box values based on a value from a combobox in an open form. one list box's value are dependent on the others; there is a many-to-one relationship. so for example:

cboSchool on formA contains a value. i press a button, formB opens and the button runs this code setting the two list boxes to appropriate values.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm stDocName, , , stLinkCriteria
  2.  
  3. Forms!frmSchoolData.lstDistrict.Value = intDist 'set new form equal to menu value
  4. Forms!frmSchoolData.lstSchool.Requery
  5. Forms!frmSchoolData.lstSchool.Value = intSchool 'set new form equal to menu value
  6. Forms!frmSchoolData.lstSchool.Requery
  7.  
this code works and all data is displayed correctly. however, the text of lstSchool does not Requery and the text remains the same. how do i get the text to update?
Dec 10 '07 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
What is the SQL statement that lstSchool is set to?
Jan 8 '08 #2

P: 65
What is the SQL statement that lstSchool is set to?
thanks, that got me looking at the problem in the right way.
Jan 11 '08 #3

Post your reply

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