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

VBA Code to accept value from form

P: 77
Hi,

I have a form with a dropdown box that has years 2000 - 2030. I am trying to write a vba code to accept the year selected on the form.
Please help me with the code to accept data from a from.

Thanks
Jan 23 '08 #1
Share this Question
Share on Google+
4 Replies


missinglinq
Expert 2.5K+
P: 3,532
Where YearTextbox is the control to hold the year selected:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YearComboBox_AfterUpdate() 
  2.   Me.YearTextbox = Me.YearComboBox
  3. End Sub
  4.  
Linq ;0)>
Jan 23 '08 #2

P: 77
Where YearTextbox is the control to hold the year selected:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YearComboBox_AfterUpdate() 
  2.   Me.YearTextbox = Me.YearComboBox
  3. End Sub
  4.  
Linq ;0)>

Thanks for the reply.

The name of my dropdown box is CBYr and the name of the button is Request Report. With these names what change do I need to make in your code to make it work?

Thanks
Jan 23 '08 #3

P: 2
1. Private Sub CBYr _AfterUpdate()
2. Me.YearTextbox = Me.YearComboBox
3. End Sub


Where

Thanks for the reply.

The name of my dropdown box is CBYr and the name of the button is Request Report. With these names what change do I need to make in your code to make it work?

Thanks
Jan 28 '08 #4

P: 2
1. Private Sub CBYr _AfterUpdate()
2. Me.YearTextbox = Me.CBYr
3. End Sub


Where CBYr will be your combo box and YearTextbox is assumed where you need the data to read.



Thanks for the reply.

The name of my dropdown box is CBYr and the name of the button is Request Report. With these names what change do I need to make in your code to make it work?

Thanks
Jan 28 '08 #5

Post your reply

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