Button to edit additional field in continous subform

S

Song Su

Since the memo field does not fit my continous subform, I want a command
button on that subform to display (edit) memo field of the same record. How
to link command button action to the record? The primary key for the subform
is AutoNumber and I have no room for tab control.

thanks.
 
A

Allen Browne

The simplest solution would be to use the built-in zoom box to enter the
data for the field.

Make sure there is a text box for your memo field on the form (even if it is
only 0.01" wide.)

In the Click event procedure of your command button:
Me.MyMemo.SetFocus
RunCommand acCmdZoomBox

Substitute the name of the text box in place of MyMemo.
 
S

Song Su

Thanks. It works great!

Allen Browne said:
The simplest solution would be to use the built-in zoom box to enter the
data for the field.

Make sure there is a text box for your memo field on the form (even if it
is only 0.01" wide.)

In the Click event procedure of your command button:
Me.MyMemo.SetFocus
RunCommand acCmdZoomBox

Substitute the name of the text box in place of MyMemo.
 
S

Song Su

I use Access 2003 and it works fine. Someone using Access 2007, to run my
application, acCmdZoomBox does not popup.
No error message. Any idea? I'm not read to move to Access 2007 for my
application yet as majority of users are Access 2003.
 
A

Allen Browne

In Access 2007,you may find that no code runs unless you add your database
folder to the list of trusted locations.

They can do this under:
Office Button | Access Options | Trust Center | Trust Center Settings
 
S

Song Su

I have 2 computers. I do all the programming on my Access 2003 Windows XP.
Then, I copied mdb/mde files to my Access 2007 Windows Vista computer.
Everything runs fine in Access 2007 except this "RunCommand acCmdZoomBox".
It flashes so quick and just would not zoom open.

I, then, put c:\users\song\appdata\elac under trusted location (song is my
user name and I also selected 'all sub-folders check), still no help.

All my other applications in that folder\sub-folder works fine. I think is
not trust location issue.

Thanks.
 
A

Allen Browne

Song Su, I have just tested this in Access 2007.
It works fine.
Tested on both a tabbed form, and a popup modal form.

There must be something in your setup blocking this.
 
S

Song Su

Dear Allen,

Then, it must be my Vista. Is there a way to use a form for edit memo field
instead of "RunCommand acCmdZoomBox"? I just want to know how to link the
form to that record's AutoNumber field. See my first post.

Thanks.
 
A

Allen Browne

Yes: you can use a form with an unbound text box.

OpenForm with the window mode acDialog, and pass the name of the control and
the value in OpenArgs.

Parse that in the form's Load event, and assign the value to the unbound
text box.

Add 2 command buttons for Ok and Cancel. In the Click event of the Ok
button, assign the value of the text box to the original control.

Of couse, it would be easier to get the zoom box working.
 
L

Linq Adams via AccessMonster.com

I agree with Allen; that's a lot of work to avoid getting the zoombox code
working!
You wouldn't even have to add a button, actually, just use the Double Click
event of your textbox:

Private Sub YourTextBox_DblClick(Cancel As Integer)
RunCommand acCmdZoomBox
End Sub

BTW, I'm fairly certain that the problem is not with Vista (although God
knows Vista has enough problems associated with it) but rather with Access
2007, which is no slouch when it comes to having problems!

Linq

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
S

Song Su

I use my work computer Access 2007 with XP and RunCommand acCmdZoomBox DOES
work! It must be my home Vista problem. I'll find another Vista machine to
try it and let you know.
 

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