ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Transferring date's from a calendar control to a text box on a use (https://www.excelbanter.com/excel-programming/418524-transferring-dates-calendar-control-text-box-use.html)

Matts

Transferring date's from a calendar control to a text box on a use
 
Hi
I'm unable to transfer the date (on clicking the calendar) to a text box on
my userform. For some reason the date gets recorded on one of my sheet tab's
where the cursor was last placed.
(Both the Calendar from & Module were imported from another Project, not
sure what I'm missing )

This is the code I've written. What amendments do i need to make ? Will
apreciate any help.
-------------
Private Sub TxtContactDate1_DblClick(ByVal cancel As MSForms.ReturnBoolean)
CalendarFrm.Show
End Sub

Private Sub CalendarFrm_Click()
Me.viewrecord.TxtContactDate1.Value = Me.CalendarFrm.Value
'ActiveCell.Value.NumberFormat = "mm/dd/yyyy"
End Sub
--------
TxtContactDate1 (is the text box on my userform)
CalendarFrm (is the form I invoke when I double click on "TxtContactDate1"


Rick Rothstein

Transferring date's from a calendar control to a text box on a use
 
Can you provide more details about this Calendar Form? Does it, in fact,
even have a Value property that you can assign elsewhere? I presume it is a
UserForm... what kind of calendar is it (a monthly display or an
appointment-type calendar)? Is the calendar portion of the UserForm an
embedded control (if so, which one) or manually constructed from other
controls (Labels, TextBoxes, CommandButtons, etc.)? How does the user signal
they are "done" with the calendar form? If a UserForm and if its code is not
overly long, perhaps pasting that code to your next post would give us
something to help us decide on a suggestion for you.

--
Rick (MVP - Excel)


"Matts" wrote in message
...
Hi
I'm unable to transfer the date (on clicking the calendar) to a text box
on
my userform. For some reason the date gets recorded on one of my sheet
tab's
where the cursor was last placed.
(Both the Calendar from & Module were imported from another Project, not
sure what I'm missing )

This is the code I've written. What amendments do i need to make ? Will
apreciate any help.
-------------
Private Sub TxtContactDate1_DblClick(ByVal cancel As
MSForms.ReturnBoolean)
CalendarFrm.Show
End Sub

Private Sub CalendarFrm_Click()
Me.viewrecord.TxtContactDate1.Value = Me.CalendarFrm.Value
'ActiveCell.Value.NumberFormat = "mm/dd/yyyy"
End Sub
--------
TxtContactDate1 (is the text box on my userform)
CalendarFrm (is the form I invoke when I double click on "TxtContactDate1"




All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com