Zoom on Comment

  • Thread starter luis_a_roman via AccessMonster.com
  • Start date
L

luis_a_roman via AccessMonster.com

I have a form that enable the user to enter comments. I want to add a button
where the user can Zoom the comment line. However, this is a comment that
will be add to a table.

I use the following code and I'm getting a run-time error 2046. The code that
Im using is as follows;
Private Sub cmdZoom_Click()
Me.jsfReqNoteName.SetFocus
DoCmd.RunCommand acCmdZoomBox
End Sub

However, when I select the comment line to be added and depress shift+pf2 it
Zooms the line. Can someone let me know how to correct the code above or
simulate in vba the Shift+pf2 command when the button is click.

Any suggestions or guidance.

Luis
 
D

Dirk Goldgar

luis_a_roman via AccessMonster.com said:
I have a form that enable the user to enter comments. I want to add a
button
where the user can Zoom the comment line. However, this is a comment that
will be add to a table.

I use the following code and I'm getting a run-time error 2046. The code
that
Im using is as follows;
Private Sub cmdZoom_Click()
Me.jsfReqNoteName.SetFocus
DoCmd.RunCommand acCmdZoomBox
End Sub

However, when I select the comment line to be added and depress shift+pf2
it
Zooms the line. Can someone let me know how to correct the code above or
simulate in vba the Shift+pf2 command when the button is click.

It looks to me like it ought to work.

1. Verify the control name.

2. What kind of control is jsfReqNoteName?

3. Is jsfReqNoteName enabled?
 
F

fredg

I have a form that enable the user to enter comments. I want to add a button
where the user can Zoom the comment line. However, this is a comment that
will be add to a table.

I use the following code and I'm getting a run-time error 2046. The code that
Im using is as follows;
Private Sub cmdZoom_Click()
Me.jsfReqNoteName.SetFocus
DoCmd.RunCommand acCmdZoomBox
End Sub

However, when I select the comment line to be added and depress shift+pf2 it
Zooms the line. Can someone let me know how to correct the code above or
simulate in vba the Shift+pf2 command when the button is click.

Any suggestions or guidance.

Luis

Your code works just fine for me as is.

Error 2046 is:
"The command or action '|' isn't available now.@* You may be in a
read-only database or an unconverted database from an earlier version
of Fred's.
* The type of object the action applies to isn't currently
selected or isn't in the active view.@Use only those commands and
macro actions that are currently available for this database.@1@@1"

Do any of those conditions apply to your database?
Is the command button on the same form as the comment field is, or is
it on a subform?

As a simple work-around, why not simply code the Comment field's
Double-click event:
DoCmd.RunCommand acCmdZoomBox.

The user simply double-clicks the control instead of clicking a
command button.

That should resolve the issue.
 
L

luis_a_roman via AccessMonster.com

You are correct. Retried the logic and it works. Thank you for guidance.

Dirk said:
I have a form that enable the user to enter comments. I want to add a
button
[quoted text clipped - 13 lines]
Zooms the line. Can someone let me know how to correct the code above or
simulate in vba the Shift+pf2 command when the button is click.

It looks to me like it ought to work.

1. Verify the control name.

2. What kind of control is jsfReqNoteName?

3. Is jsfReqNoteName enabled?
 

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