Solved

Monthly Scheduler

Posted on 2012-12-22
10
294 Views
Last Modified: 2012-12-23
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
0
Comment
Question by:chestera
  • 5
  • 3
  • 2
10 Comments
 
LVL 39

Assisted Solution

by:als315
als315 earned 334 total points
Comment Utility
Look at sample
DBFieldsize.mdb
0
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 166 total points
Comment Utility
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

0
 

Author Comment

by:chestera
Comment Utility
als315

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

chestera
0
 
LVL 39

Accepted Solution

by:
als315 earned 334 total points
Comment Utility
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.
0
 

Author Closing Comment

by:chestera
Comment Utility
irogsinta

Many thanks for your input. I have split the points

chestera
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:chestera
Comment Utility
als315

Again thank you for that sample dB

chestera
0
 
LVL 29

Expert Comment

by:IrogSinta
Comment Utility
Here's a 30 day version.  To change the size of the large text box just change the constants largeWidthCm and largeHeightCm.
0
 

Author Comment

by:chestera
Comment Utility
Irog/sinta

Thank you again

All the best
Alan
0
 
LVL 29

Expert Comment

by:IrogSinta
Comment Utility
Last one.  This one includes labels and month traversal.
Calendar.accdb
0
 

Author Comment

by:chestera
Comment Utility
IrongSinta

Excellent and thank you

Alan
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now