424,054 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,054 IT Pros & Developers. It's quick & easy.

Auto populate almost fixed

P: 10
First off, THANKYOU Adezii ! Worked good but...3 things I still have a problem with

Here is the code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub List166_AfterUpdate()
  2.  
  3.  
  4. Me![lstUPC] = Me![List166].Column(0)
  5. Me![txtPARA] = Me![List166].Column(1)
  6. Me![txtLine] = Me![List166].Column(2)
  7. Me![lstPosition Title] = Me![List166].Column(3)
  8. Me![lstRank] = Me![List166].Column(4)
  9. Me![lstGrade] = Me![List166].Column(5)
  10. Me![txtDMOS] = Me![List166].Column(6)
  11. Me![lstID Code] = Me![List166].Column(7)
  12. Me![txtASI I] = Me![List166].Column(8)
  13. Me![txtASI II] = Me![List166].Column(9)
  14. Me![txtASI III] = Me![List166].Column(10)
  15. Me![txtMTOE Required] = Me![List166].Column(11)
  16. Me![txtAUTH] = Me![List166].Column(12)
  17. End Sub
  18.  
First is the first one lstUPC and the lstGrade doesnt get changed/ filled in,

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesnt stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.

Thank you

Harry
Jan 23 '08 #1
Share this Question
Share on Google+
2 Replies


P: 62
After changing the values of the lists, did you try requerying the form objects?

Me!Control_name.Requery



First off, THANKYOU Adezii ! Worked good but...3 things I still have a problem with

Here is the code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub List166_AfterUpdate()
  2.  
  3.  
  4. Me![lstUPC] = Me![List166].Column(0)
  5. Me![txtPARA] = Me![List166].Column(1)
  6. Me![txtLine] = Me![List166].Column(2)
  7. Me![lstPosition Title] = Me![List166].Column(3)
  8. Me![lstRank] = Me![List166].Column(4)
  9. Me![lstGrade] = Me![List166].Column(5)
  10. Me![txtDMOS] = Me![List166].Column(6)
  11. Me![lstID Code] = Me![List166].Column(7)
  12. Me![txtASI I] = Me![List166].Column(8)
  13. Me![txtASI II] = Me![List166].Column(9)
  14. Me![txtASI III] = Me![List166].Column(10)
  15. Me![txtMTOE Required] = Me![List166].Column(11)
  16. Me![txtAUTH] = Me![List166].Column(12)
  17. End Sub
  18.  
First is the first one lstUPC and the lstGrade doesnt get changed/ filled in,

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesnt stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.

Thank you

Harry
Jan 28 '08 #2

jaxjagfan
Expert 100+
P: 254
First off, THANKYOU Adezii ! Worked good but...3 things I still have a problem with

Here is the code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub List166_AfterUpdate()
  2.  
  3.  
  4. Me![lstUPC] = Me![List166].Column(0)
  5. Me![txtPARA] = Me![List166].Column(1)
  6. Me![txtLine] = Me![List166].Column(2)
  7. Me![lstPosition Title] = Me![List166].Column(3)
  8. Me![lstRank] = Me![List166].Column(4)
  9. Me![lstGrade] = Me![List166].Column(5)
  10. Me![txtDMOS] = Me![List166].Column(6)
  11. Me![lstID Code] = Me![List166].Column(7)
  12. Me![txtASI I] = Me![List166].Column(8)
  13. Me![txtASI II] = Me![List166].Column(9)
  14. Me![txtASI III] = Me![List166].Column(10)
  15. Me![txtMTOE Required] = Me![List166].Column(11)
  16. Me![txtAUTH] = Me![List166].Column(12)
  17. End Sub
  18.  
First is the first one lstUPC and the lstGrade doesnt get changed/ filled in,

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesnt stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.

Thank you

Harry
Adezii is very thorough

If your naming convention is true, I assume lstIPC and lstGrade are listboxes. You cannot set the value of a listbox. If you change these to combobox (cboPC and cboGrade) then you can set the values. You have to be cautious on the Limit to List property of the combo's when doing this.

No need to answer but - Why are you doing this on After_Update and not On_Click or On_DoubleClick?
Jan 28 '08 #3

Post your reply

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