Hi,
I am working in a userform and I need to find out how I could set a field for date and have a calendar drop down in it?
Any ideas or codes anyone?
Thanks in advance!
Hi,
I am working in a userform and I need to find out how I could set a field for date and have a calendar drop down in it?
Any ideas or codes anyone?
Thanks in advance!
Last edited by sentinela; 04-27-2009 at 03:28 PM.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Hey RoyUK....
Thanks for the reply. I am not sure if I didn't understand you correctly, but here is my spreadsheet.
If you could kindly look at the code and tell me where I messed up, I would greatly appreciate...
Thanks for the help!
If you are trying to use the calendar form example then you haven't copied all the code - you need the Class module as well and the userform
The combobox one may be simpler for you to adapt.
Also, why are you using Application, refer to thde UserForm with the key word Me.
You can't use target with a UserForm, you would use something like Activecell or Selection.
Last edited by royUK; 04-27-2009 at 03:03 PM.
I've just noticed that you have named the userform application, you can't do that because application is reserved by Excel to refer to the Excel Application
I appreciated the help, and your patience in my learning...
I used application because I didn't know I could use Me as keyword.
How about if I have 2 or 3 forms, what would the keyword be for the others?
I actually just want to have the calendar drop down in the ComboBox2.
Do I just copy your form and paste there?
Thanks again for all your help!
I've amended your code but it's not clear what your form is intended to do.
Me.How about if I have 2 or 3 forms, what would the keyword be for the others?
Me in a sheet module refers to the associated sheet; in ThisWorkbook, refers to ThisWorkbook; and in the code module of a form, refers to the form.
To refer to another form's control, use instead the form name, e.g., UserFormx.TextBox1.
But it's bad practice -- only code in the form's code module should refer it its controls. That gives code a measure of modularity, reducing the scope of changes if the controls on a particular form change.
Entia non sunt multiplicanda sine necessitate
I'm not clear what you want to do, you cannot add a date control to the combobox.
Have a look at the examples
Dear RoyUK.... That's exactly what I wanted....
Wonderful.... Thanks for the major help, you have no idea how this got me so happy to see it working.
shg...
Thanks for the good explanation.
I take it, that you are telling me not to use Me.... is that correct? Or if this was your project, what would you use?
Thank you so much for all the help!
Roy...
That is just a invoice system that I am creating. The date is just for reference. There is nothing into it. After the done button is clicked, it is just going to summarize for me in another sheet.
I am sure you will see more questions on this project, since I am just now learning VBA.
Again, thanks for the help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks