jamesperrin1976
New Member
- Joined
- Feb 8, 2009
- Messages
- 13
I have used a date time picker control on my userform along with a lot of text boxes, combo boxes etc. When I select the OK command button on the form I want to call a macro module to create a table in worksheet 1 of the values selected on the form. I don't have a problem with adding the text box or combo box values to a cell in that table but when i try to set the value of a cell to the date selected in the date time picker control I only get "00-Jan-00" instead of the selected date (I have formatted the cell to show dates as "dd-MMM-yy").
Can anyone help me? I think it might have something to do with passing the date from the form to the module but I don't know enough about VBA to work it out!
For info I am using Excel 2003 and the line in my module to set the cell value to the date time picker control from the form is:
Where "i" is the column number in the loop i am running, frmWorksOrder is the userform and dtpIssueDate is the date time picker control.
Regards,
James
Can anyone help me? I think it might have something to do with passing the date from the form to the module but I don't know enough about VBA to work it out!
For info I am using Excel 2003 and the line in my module to set the cell value to the date time picker control from the form is:
Code:
Cells(7, i).Value = frmWorksOrder.dtpIssueDate.Value
Where "i" is the column number in the loop i am running, frmWorksOrder is the userform and dtpIssueDate is the date time picker control.
Regards,
James