Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Monthly Scheduler

Posted on 2012-12-22
10
Medium Priority
?
309 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 40

Assisted Solution

by:als315
als315 earned 1336 total points
ID: 38716536
Look at sample
DBFieldsize.mdb
0
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 664 total points
ID: 38716543
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
ID: 38716858
als315

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

chestera
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 40

Accepted Solution

by:
als315 earned 1336 total points
ID: 38717022
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
ID: 38717402
irogsinta

Many thanks for your input. I have split the points

chestera
0
 

Author Comment

by:chestera
ID: 38717405
als315

Again thank you for that sample dB

chestera
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38717420
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
ID: 38717539
Irog/sinta

Thank you again

All the best
Alan
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38717680
Last one.  This one includes labels and month traversal.
Calendar.accdb
0
 

Author Comment

by:chestera
ID: 38717772
IrongSinta

Excellent and thank you

Alan
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

885 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