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

Text box dosn't calculate until combo box choice is reselected

P: 37
Hi everybody, first off thank you all for your help, without it, years would have been taken off my life had it not been for this forum.

I have a piece of code in my combo box so when some one selects a certain option "Mastercard" or "Visa" other boxes appear to fill in details and some calculations are made in a another text box... code below...
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Deposit1PaymentMethodBox_AfterUpdate()
  3.     If Deposit1PaymentMethodBox = "Visa" Or Deposit1PaymentMethodBox = "Mastercard" Then
  4.         CardNumber1_Label.Visible = True
  5.         CardNumber1Box.Visible = True
  6.         ExpireDate1_Label.Visible = True
  7.         ExpireDateBox1.Visible = True
  8.         DepAuth1_Label.Visible = True
  9.         DepAuth1Box.Visible = True
  10.         Dep1AdminFeeBox = Deposit1AmountBox * 0.03
  11.     Else
  12.         CardNumber1_Label.Visible = False
  13.         CardNumber1Box.Visible = False
  14.         ExpireDate1_Label.Visible = False
  15.         ExpireDateBox1.Visible = False
  16.         DepAuth1_Label.Visible = False
  17.         DepAuth1Box.Visible = False
  18.         Dep1AdminFeeBox = 0
  19.     End If
  20. End Sub
  21.  
...but the code only kicks in when I choose the option in the combobox (Deposit1PaymentMethodBox) a second time. Am I missing a piece of code to re select the button?

Cheers in advance Eddie
Jun 5 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi Eddie,

You say this code is only being triggered when you select the combo box a second time. Do you mean on form load or change or do you actually have to select the combo box value twice?

Mary
Jun 5 '07 #2

P: 37
Hi Mary,
I have to select the option twice
Jun 5 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
I'm not sure why this is. Try the minor changes below and see if that helps.
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Deposit1PaymentMethodBox_AfterUpdate()
  3. If Me!Deposit1PaymentMethodBox = "Visa" Or Me!Deposit1PaymentMethodBox = "Mastercard" Then
  4. CardNumber1_Label.Visible = True
  5. CardNumber1Box.Visible = True
  6. ExpireDate1_Label.Visible = True
  7. ExpireDateBox1.Visible = True
  8. DepAuth1_Label.Visible = True
  9. DepAuth1Box.Visible = True
  10. Dep1AdminFeeBox = Deposit1AmountBox * 0.03
  11. Else
  12. CardNumber1_Label.Visible = False
  13. CardNumber1Box.Visible = False
  14. ExpireDate1_Label.Visible = False
  15. ExpireDateBox1.Visible = False
  16. DepAuth1_Label.Visible = False
  17. DepAuth1Box.Visible = False
  18. Dep1AdminFeeBox = 0
  19. End If
  20. End Sub
  21.  
Jun 5 '07 #4

Post your reply

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