Monthly Scheduler

chestera
chestera used Ask the Experts™
on
Hi EE
I am playing with developing a simple Monthly scheduler the text box for each day is
Width 3cm and Height is 2cm. Is there a way via vba when clicking on a text box it can expand to a given size. I would like  to click on a given day, box opens up then enter text for that day when exit the box shrinks back to original size. Any help appreciated

chestera
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You could use this code:
 
Dim sLastOne As String
Const cmTwips As Integer = 567

Private Sub ExpandMe()
    'expand textbox
    With Me.ActiveControl
        .Width = 5 * cmTwips
        .Height = 4 * cmTwips
        sLastOne = Me.ActiveControl.name
    End With
End Sub

Private Sub RestoreMe()
    'restore textbox
    If sLastOne <> "" Then
        Me.Controls(sLastOne).Width = 3 * cmTwips
        Me.Controls(sLastOne).Height = 1 * cmTwips
    End If
End Sub

Private Sub Detail_Click()
    RestoreMe
End Sub

Private Sub tDay1_GotFocus()
    ExpandMe
End Sub
Private Sub tDay2_GotFocus()
    ExpandMe
End Sub
Private Sub tDay3_GotFocus()
    ExpandMe
End Sub

Private Sub tDay1_LostFocus()
    RestoreMe
End Sub
Private Sub tDay2_LostFocus()
    RestoreMe
End Sub
Private Sub tDay3_LostFocus()
    RestoreMe
End Sub

Open in new window

Author

Commented:
als315

Thank you for that just what I am looking for do you mind if I split the paints.

chestera
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

chestera: you can assign points as you like. Ron's solution is universal - you can use it on any control if they have same siza.

Author

Commented:
irogsinta

Many thanks for your input. I have split the points

chestera

Author

Commented:
als315

Again thank you for that sample dB

chestera
Here's a 30 day version.  To change the size of the large text box just change the constants largeWidthCm and largeHeightCm.

Author

Commented:
Irog/sinta

Thank you again

All the best
Alan
Last one.  This one includes labels and month traversal.
Calendar.accdb

Author

Commented:
IrongSinta

Excellent and thank you

Alan

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial