Hi guys,
Using the code beneath to set a datepicker to show the current date and update a textbox which is linked to it, however the previous date that was in the textbox is staying visible and the new date is underneath it. I.e you have to delete the old date out before the new date is visible. I've seen this code before unbound_ctrl_Date = DTPicker1.Value but not sure how to incorporate it.
Private Sub Workbook_Open()
Dim objOLE As Object
For Each objOLE In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOLE.Object) = "DTPicker" Then
objOLE.Object.Value = Date
End If
Next objOLE
Dim objOL As Object
For Each objOL In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOL.Object) = "TextBox28" Then
objOL.Object.Value = DTPicker1
End If
Next objOL
End Sub
Thanks
Using the code beneath to set a datepicker to show the current date and update a textbox which is linked to it, however the previous date that was in the textbox is staying visible and the new date is underneath it. I.e you have to delete the old date out before the new date is visible. I've seen this code before unbound_ctrl_Date = DTPicker1.Value but not sure how to incorporate it.
Private Sub Workbook_Open()
Dim objOLE As Object
For Each objOLE In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOLE.Object) = "DTPicker" Then
objOLE.Object.Value = Date
End If
Next objOLE
Dim objOL As Object
For Each objOL In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOL.Object) = "TextBox28" Then
objOL.Object.Value = DTPicker1
End If
Next objOL
End Sub
Thanks