Subform field - dynamic field size - help

G

Guest

Hi

I have 2 tab control pages holding 3 subforms [tasks, donations and notes].
Each of these subforms has a comments field that I've set as a memo.

My problem is I don't want to set the comments field size permanently too
large as it would take up too much room on the screen [some clients will have
50 donations records etc]. Is there a way that this field can grow
dynamically, so that it only grows to the size of the characters within it
WHEN you're actually in the field. [sort of like the comments field in excel
that only pop up big when you're in that cell]

TIA

Sue
 
T

tina

i don't know of any way to do that, but you could do the next best thing
(kind of). you can set code in the control to open a Zoom box, which is
simply a window that has a lot more room to show a control's contents. an
easy way to do this is to open the form in Design view, open the Properties
box, click the Other tab and set the ShortcutMenu property to No. then click
on the control that's bound to the memo field, go back to the Properties
box, click the Events tab and scroll to the OnMouseDown event. add an event
procedure to the event, and add the following code in the procedure, as

If Button = acRightButton Then
DoCmd.RunCommand acCmdZoomBox
End If

if you don't know how to create an event procedure, see "Create a VBA event
procedure" at http://home.att.net/~california.db/downloads.html for
illustrated instructions.

hth
 
G

Guest

Hi Tina

You've helped me before - you're a gem.

This is brilliant and I've got it working [well it zooms anyway] - but I'm
thinking. If my user is use to getting around the form using a keyboard -
this means they have to take their hands off the keyboard to [right mouse
click] to get it to zoom. Is there another "on" field I should be using for
the keyboard operator? I tried Before Update and Got Focus but they didn't
work.

Cheers


--
Sue Compelling


tina said:
i don't know of any way to do that, but you could do the next best thing
(kind of). you can set code in the control to open a Zoom box, which is
simply a window that has a lot more room to show a control's contents. an
easy way to do this is to open the form in Design view, open the Properties
box, click the Other tab and set the ShortcutMenu property to No. then click
on the control that's bound to the memo field, go back to the Properties
box, click the Events tab and scroll to the OnMouseDown event. add an event
procedure to the event, and add the following code in the procedure, as

If Button = acRightButton Then
DoCmd.RunCommand acCmdZoomBox
End If

if you don't know how to create an event procedure, see "Create a VBA event
procedure" at http://home.att.net/~california.db/downloads.html for
illustrated instructions.

hth


Sue Compelling said:
Hi

I have 2 tab control pages holding 3 subforms [tasks, donations and notes].
Each of these subforms has a comments field that I've set as a memo.

My problem is I don't want to set the comments field size permanently too
large as it would take up too much room on the screen [some clients will have
50 donations records etc]. Is there a way that this field can grow
dynamically, so that it only grows to the size of the characters within it
WHEN you're actually in the field. [sort of like the comments field in excel
that only pop up big when you're in that cell]

TIA

Sue
 
T

tina

not sure what you mean by
Is there another "on" field I should be using for
the keyboard operator?

if you want the Zoom box to open *every time* the user enters the memo
control, you can use the control's Enter event procedure to run the code i
gave you previously.

if you want to open the Zoom box by using a keyboard combination that works
*in that control only*, you use the memo control's KeyDown event procedure
to run the following code, as

If (Shift And acAltMask) > 0 Then
If KeyCode = 90 Then
DoCmd.RunCommand acCmdZoomBox
End If
End If

(Shift And acAltMask) > 0 tests to see if the Alt key is pressed. if it is,
then KeyCode = 90 is true if the letter "z" is also pressed, which is what
you'll get if you press Alt+z on the keyboard. if z is pressed, then the
Zoom box opens.
note that you can test for the Shift key or Ctrl key instead of the Alt key
(though i wouldn't because Ctrl+z runs the Windows default action "paste
from clipboard", and your user may need to use the Shift key to type a
capital Z); you can also test for another key besides "z" if you want - z
for zoom just made sense to me.

btw, one advantage here is that you can "turn back ON" the form's Shortcut
Menu setting that i instructed you to turn off for the "right click"
solution. so you can allow your user access to the shortcut menu in the
form, if you choose.

hth


Sue Compelling said:
Hi Tina

You've helped me before - you're a gem.

This is brilliant and I've got it working [well it zooms anyway] - but I'm
thinking. If my user is use to getting around the form using a keyboard -
this means they have to take their hands off the keyboard to [right mouse
click] to get it to zoom. Is there another "on" field I should be using for
the keyboard operator? I tried Before Update and Got Focus but they didn't
work.

Cheers


--
Sue Compelling


tina said:
i don't know of any way to do that, but you could do the next best thing
(kind of). you can set code in the control to open a Zoom box, which is
simply a window that has a lot more room to show a control's contents. an
easy way to do this is to open the form in Design view, open the Properties
box, click the Other tab and set the ShortcutMenu property to No. then click
on the control that's bound to the memo field, go back to the Properties
box, click the Events tab and scroll to the OnMouseDown event. add an event
procedure to the event, and add the following code in the procedure, as

If Button = acRightButton Then
DoCmd.RunCommand acCmdZoomBox
End If

if you don't know how to create an event procedure, see "Create a VBA event
procedure" at http://home.att.net/~california.db/downloads.html for
illustrated instructions.

hth


Hi

I have 2 tab control pages holding 3 subforms [tasks, donations and notes].
Each of these subforms has a comments field that I've set as a memo.

My problem is I don't want to set the comments field size permanently too
large as it would take up too much room on the screen [some clients
will
have
50 donations records etc]. Is there a way that this field can grow
dynamically, so that it only grows to the size of the characters within it
WHEN you're actually in the field. [sort of like the comments field
in
excel
that only pop up big when you're in that cell]

TIA

Sue
 
G

Guest

Brilliant - thanks Tina, I took the ALT Z option ... and agree with [and
understand] your logic
--
Sue Compelling


tina said:
not sure what you mean by
Is there another "on" field I should be using for
the keyboard operator?

if you want the Zoom box to open *every time* the user enters the memo
control, you can use the control's Enter event procedure to run the code i
gave you previously.

if you want to open the Zoom box by using a keyboard combination that works
*in that control only*, you use the memo control's KeyDown event procedure
to run the following code, as

If (Shift And acAltMask) > 0 Then
If KeyCode = 90 Then
DoCmd.RunCommand acCmdZoomBox
End If
End If

(Shift And acAltMask) > 0 tests to see if the Alt key is pressed. if it is,
then KeyCode = 90 is true if the letter "z" is also pressed, which is what
you'll get if you press Alt+z on the keyboard. if z is pressed, then the
Zoom box opens.
note that you can test for the Shift key or Ctrl key instead of the Alt key
(though i wouldn't because Ctrl+z runs the Windows default action "paste
from clipboard", and your user may need to use the Shift key to type a
capital Z); you can also test for another key besides "z" if you want - z
for zoom just made sense to me.

btw, one advantage here is that you can "turn back ON" the form's Shortcut
Menu setting that i instructed you to turn off for the "right click"
solution. so you can allow your user access to the shortcut menu in the
form, if you choose.

hth


Sue Compelling said:
Hi Tina

You've helped me before - you're a gem.

This is brilliant and I've got it working [well it zooms anyway] - but I'm
thinking. If my user is use to getting around the form using a keyboard -
this means they have to take their hands off the keyboard to [right mouse
click] to get it to zoom. Is there another "on" field I should be using for
the keyboard operator? I tried Before Update and Got Focus but they didn't
work.

Cheers


--
Sue Compelling


tina said:
i don't know of any way to do that, but you could do the next best thing
(kind of). you can set code in the control to open a Zoom box, which is
simply a window that has a lot more room to show a control's contents. an
easy way to do this is to open the form in Design view, open the Properties
box, click the Other tab and set the ShortcutMenu property to No. then click
on the control that's bound to the memo field, go back to the Properties
box, click the Events tab and scroll to the OnMouseDown event. add an event
procedure to the event, and add the following code in the procedure, as

If Button = acRightButton Then
DoCmd.RunCommand acCmdZoomBox
End If

if you don't know how to create an event procedure, see "Create a VBA event
procedure" at http://home.att.net/~california.db/downloads.html for
illustrated instructions.

hth


Hi

I have 2 tab control pages holding 3 subforms [tasks, donations and
notes].
Each of these subforms has a comments field that I've set as a memo.

My problem is I don't want to set the comments field size permanently too
large as it would take up too much room on the screen [some clients will
have
50 donations records etc]. Is there a way that this field can grow
dynamically, so that it only grows to the size of the characters within it
WHEN you're actually in the field. [sort of like the comments field in
excel
that only pop up big when you're in that cell]

TIA

Sue
 
T

tina

you're welcome, glad it met your needs :)


Sue Compelling said:
Brilliant - thanks Tina, I took the ALT Z option ... and agree with [and
understand] your logic
--
Sue Compelling


tina said:
not sure what you mean by
Is there another "on" field I should be using for
the keyboard operator?

if you want the Zoom box to open *every time* the user enters the memo
control, you can use the control's Enter event procedure to run the code i
gave you previously.

if you want to open the Zoom box by using a keyboard combination that works
*in that control only*, you use the memo control's KeyDown event procedure
to run the following code, as

If (Shift And acAltMask) > 0 Then
If KeyCode = 90 Then
DoCmd.RunCommand acCmdZoomBox
End If
End If

(Shift And acAltMask) > 0 tests to see if the Alt key is pressed. if it is,
then KeyCode = 90 is true if the letter "z" is also pressed, which is what
you'll get if you press Alt+z on the keyboard. if z is pressed, then the
Zoom box opens.
note that you can test for the Shift key or Ctrl key instead of the Alt key
(though i wouldn't because Ctrl+z runs the Windows default action "paste
from clipboard", and your user may need to use the Shift key to type a
capital Z); you can also test for another key besides "z" if you want - z
for zoom just made sense to me.

btw, one advantage here is that you can "turn back ON" the form's Shortcut
Menu setting that i instructed you to turn off for the "right click"
solution. so you can allow your user access to the shortcut menu in the
form, if you choose.

hth


Hi Tina

You've helped me before - you're a gem.

This is brilliant and I've got it working [well it zooms anyway] - but I'm
thinking. If my user is use to getting around the form using a keyboard -
this means they have to take their hands off the keyboard to [right mouse
click] to get it to zoom. Is there another "on" field I should be
using
for
the keyboard operator? I tried Before Update and Got Focus but they didn't
work.

Cheers


--
Sue Compelling


:

i don't know of any way to do that, but you could do the next best thing
(kind of). you can set code in the control to open a Zoom box, which is
simply a window that has a lot more room to show a control's
contents.
an
easy way to do this is to open the form in Design view, open the Properties
box, click the Other tab and set the ShortcutMenu property to No.
then
click
on the control that's bound to the memo field, go back to the Properties
box, click the Events tab and scroll to the OnMouseDown event. add
an
event
procedure to the event, and add the following code in the procedure, as

If Button = acRightButton Then
DoCmd.RunCommand acCmdZoomBox
End If

if you don't know how to create an event procedure, see "Create a
VBA
event
procedure" at http://home.att.net/~california.db/downloads.html for
illustrated instructions.

hth


Hi

I have 2 tab control pages holding 3 subforms [tasks, donations and
notes].
Each of these subforms has a comments field that I've set as a memo.

My problem is I don't want to set the comments field size
permanently
too
large as it would take up too much room on the screen [some
clients
will
have
50 donations records etc]. Is there a way that this field can grow
dynamically, so that it only grows to the size of the characters within it
WHEN you're actually in the field. [sort of like the comments
field
in
excel
that only pop up big when you're in that cell]

TIA

Sue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top