Zoom box

A

Arturo

I am using the following to expand a memo field.

DailyNotes.SetFocus
DoCmd.RunCommand acCmdZoomBox

How do I get the cursor to go to the end of the filed?

Thank you.
 
R

ruralguy via AccessMonster.com

Try:

Me.DailyNotes.SetFocus
DoCmd.RunCommand acCmdZoomBox
Me.DailyNotes.SelStart = Len(Me.DailyNotes)
 
A

Arturo

No, it didn't work. Let me qualify that a little more. I want the cursor to
go to the end of the Zoom Box when it opens.

Thank you.
 
L

Linq Adams via AccessMonster.com

I, too, don't like the limitations of the standard ZoomBox, so I rolled my
own a while back.

Place a large text box (call it MyZoomBox) on your form. Assign it the same
Control Source as the field you want to expand, and make it visible by double
clicking the field you want expanded.

Substitute the actual name of your field to be expanded for YourTextBox.

Private Sub Form_Load()
'Make MyZoomBox invisible on loading the form
MyZoomBox.Visible = False
End Sub


Private Sub YourTextBox_DblClick(Cancel As Integer)
'When you double click the field, make MyZoomBox Visible
MyZoomBox.Visible = True
MyZoomBox.SetFocus
MyZoomBox.SelStart =Len(Me.MyZoomBox)
End Sub

Private Sub MyZoomBox_DblClick(Cancel As Integer)
'Double click the MyZoomBox to close it and
'return to your original field
Me.YourTextBox.SetFocus
MyZoomBox.Visible = False
End Sub
 
R

ruralguy via AccessMonster.com

Thanks Linq,

Linq said:
I, too, don't like the limitations of the standard ZoomBox, so I rolled my
own a while back.

Place a large text box (call it MyZoomBox) on your form. Assign it the same
Control Source as the field you want to expand, and make it visible by double
clicking the field you want expanded.

Substitute the actual name of your field to be expanded for YourTextBox.

Private Sub Form_Load()
'Make MyZoomBox invisible on loading the form
MyZoomBox.Visible = False
End Sub

Private Sub YourTextBox_DblClick(Cancel As Integer)
'When you double click the field, make MyZoomBox Visible
MyZoomBox.Visible = True
MyZoomBox.SetFocus
MyZoomBox.SelStart =Len(Me.MyZoomBox)
End Sub

Private Sub MyZoomBox_DblClick(Cancel As Integer)
'Double click the MyZoomBox to close it and
'return to your original field
Me.YourTextBox.SetFocus
MyZoomBox.Visible = False
End Sub
 
D

Damon Heron

Continuous form should not make any difference, as long as you use the nav
buttons to move thru the form, and in the current event put
MyZoomBox.visible= false

You can make the zoombox as big as the entire form, if you want. Use a BIG
font!

Also, by making this a simple subroutine, you can call it from multiple
bound textboxes,
like this:

Private Sub txt1_DblClick(Cancel As Integer)
Zoomin (Me.txt1.ControlSource)
End Sub

Sub Zoomin(ctrlsource As String)
MyZoomBox.Visible = True
MyZoomBox.ControlSource = ctrlsource
MyZoomBox.SetFocus
MyZoomBox.SelStart = Nz(Len(Me.MyZoomBox), 0)
End Sub

Damon
 

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