UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Zoombox Command Not Working In Distributed Package, Office 2007    
 
   
whatsit
post May 5 2012, 04:32 PM
Post #1

UtterAccess Member
Posts: 32



Hi All

I have a small application that I have packaged for distribution using MS Access 2007 Package Solution Wizard. For some reason, I am having problems with the “zoom box” command.

I have a double click event in a memo control. I used: “DoCmd.RunCommand acCmdZoomBox” and it works fine on my machine but does not work on the machines I’ve distributed to. I also tried setting up a separate command button and again, it works fine on my machine but not the others. It also appears that using the old standby “Shift + F2 doesn’t work either.

What bone head move have I managed to make this time??

Thanks in advance.
Go to the top of the page
 
+
pere_de_chipstic...
post May 5 2012, 04:54 PM
Post #2

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi whatsit

I've found this same problem, believe me it is not any bone head move you've made, but if you are using runtime then the zoombox command is not available!

You can work around this by creating a pop form to emulate the zoom box.

hth
Go to the top of the page
 
+
whatsit
post May 5 2012, 05:05 PM
Post #3

UtterAccess Member
Posts: 32



Thanks very much for taking the time to reply...

I am not a pro at this stuff just more of a challenging "hobby" I indulge in to volunteer with various organizations so forgive me if what I ask is elementary:

So, if I have to develop a pop up form, do I set the record source to the control on the original form? And if changes are made in the pop up form, will they populate the original underlying form?
Go to the top of the page
 
+
philben
post May 6 2012, 02:03 AM
Post #4

UtterAccess Member
Posts: 22



Hi,

Example of an advanced Zoombox (.accdb format and it uses DAO) but without explanation (sorry)! :
  • Real zoom (0% to x%)
  • Characters left (with color gradient) or no. of characters
  • Rich text or not
  • Resizable
  • Reproduces some properties of the original control (width, backcolor, forecolor, font...)

Philippe
Go to the top of the page
 
+
pere_de_chipstic...
post May 6 2012, 02:07 AM
Post #5

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi whatsit
QUOTE
do I set the record source to the control on the original form? And if changes are made in the pop up form, will they populate the original underlying form?

You could do it this way, you would need to ensure that as part of the process for opening the pop up form the record on the original underlying form was saved, and you would also need to requery the original form when you closed the pop up form.

I used a common pop up form for the zoom box, which was called by a number of different controls in different forms; my implementation was to copy the data from the source control to the control on the pop up box and copy it back to the original form when the pop up was closed with an 'OK' button. The pop up form itself was bound to a single record "'Admin" table in the db Front End, with the 'zoom' text control bound to a field in that table.

hth
Go to the top of the page
 
+
whatsit
post May 6 2012, 10:54 AM
Post #6

UtterAccess Member
Posts: 32



I apologize for the tardy response. I was called away unexpectedly…

Bernie, thanks for the explanation. Very helpful.

Philippe, thank you for the additional information and file.

I will tackle this latest problem sometime today and reply with anything I determine may help others in the future.

Thanks again
Go to the top of the page
 
+
whatsit
post May 12 2012, 03:15 PM
Post #7

UtterAccess Member
Posts: 32



Hello again

After several weeks and further research, I have returned to offer an additional solution to the zoom box problem in runtime. To give full credit where credit is due, I stumbled on to this rather elegant solution as posted by Marshall Barton (aka Marsh) on another forum. I would have passed this along sooner but as I stated above, I am a rank amateur with Access and I always try to understand what it is other’s suggest especially when coding. I had never seen “OpenArgs” before and it took quite some time for me to understand how it worked. I also needed to apply Mr. Baton’s approach to a subform control (his post referenced a text box on a main form). Long story short, it takes me ages to wrap my head around most of this “stuff”.

Mr. Barton’s solution creates a single unbound form to be used as a dialog box (much like a custom input box) and then uses it as needed throughout the application. I am including what I finally came up with to initiate a “zoom box” in my runtime application. My version is probably clunky but it helps me understand what I’m doing. Bear in mind that I needed to enlarge or zoom a subform control nested in a main form:

1) Create unbound form with a single large text box ( I also made it a popup and modal) and named it “frmMyZoom”

I placed a command button on the main form (I thought about using the double click event of the control I wanted to enlarge but this looked better on the form) and set the click event as follows:

DoCmd.OpenForm “frmMyZoom”, WindowMode:= acDialog, OpenArgs:= Forms!_
frmMainFormName! frmSubformName.SubformControlName

If CurrentProject.AllForms!frmMyZoom.IsLoaded Then
frmSubformName!SubformControlName(control you want to “zoom”)_
= Forms!frmMyZoom.Name (name of frmMyZoom dialog box)
End If

DoCmd.Close acFrom, “frmMyZoom”, acSaveNo

End Sub

2) Code for frmMyZoom

Sub Form_Load()
Me.Name of text field control = Me.OpenArgs
End Sub

Sub btnOK_Click()
Me.Visible = False
End Sub
Sub btnCancel_Click()
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

An example of the code I used to “zoom” one of the controls on a nested subform:

Private Sub EnlargeDetails_Click()
On Error GoTo Err_EnlargeDetails_Click


DoCmd.OpenForm "frmMyZoom", windowmode:=acDialog, OpenArgs:=Forms!frmNewConMain!frmNewConPermitsSubform!Details

If CurrentProject.AllForms!frmMyZoom.IsLoaded Then
frmNewConPermitsSubform!Details = Forms!frmMyZoom.Details

End If

DoCmd.Close acForm, "frmMyZoom", acSaveNo

Exit_EnlargeDetails_Click:
Exit Sub

Err_EnlargeDetails_Click:
MsgBox Err.Description
Resume Exit_EnlargeDetails_Click

End Sub


I thank Marshall Barton and I hope this will help others


Go to the top of the page
 
+
Aquadevel
post May 12 2012, 03:37 PM
Post #8

UtterAccess VIP
Posts: 6,898
From: Earth...




Hi,

I just use the following in a module:

CODE
[/code]

Function ZoomMe()
'pop up the ZOOM box for editing
'usually used in text boxes where the text
'may be longer than the display
On Error Resume Next
DoCmd.RunCommand acCmdZoomBox
End Function

[code]


and use this on the double-click event, to upen the zoombox:

=Zoomme()

Works great

Good luck with your project!



Go to the top of the page
 
+
whatsit
post May 12 2012, 03:45 PM
Post #9

UtterAccess Member
Posts: 32



Hi Aqua

Are you saying that by putting your code into a module, the acCmdZoomBox will work in the runtime environment? It is my understanding that acCmdZoomBox is not available when the ap is packaged as a runtime
Go to the top of the page
 
+
Aquadevel
post May 12 2012, 03:48 PM
Post #10

UtterAccess VIP
Posts: 6,898
From: Earth...





Hi What,

Yea, I use it all the time in 2007's runtime.

I just completed a form where I'm using it in like 6 different controls, due 'real estate' in the form sixe.

Good luck with your project!
Go to the top of the page
 
+
pere_de_chipstic...
post May 12 2012, 04:43 PM
Post #11

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi Aqua and whatsit

There have been some discussions about this in earlier threads (e.g. here), and here where the response to a similar 'zoombox not working in runtime' question is
QUOTE
... According to microsoft :
Unfortunately, the zoom box functionality is contained in one of the wizard files (utility.accda). Wizard files are not redistributable and are only meant to be used with full versions of Access. ...
though the response goes on to provide a method to get around this.

So whether the zoombox works in runtime (or not) seems dependent on whether another file has already been installed on the host PC. So I would be cautious about assuming that the zoombox will work in every target PC using runtime.

hth
Go to the top of the page
 
+
whatsit
post May 12 2012, 05:36 PM
Post #12

UtterAccess Member
Posts: 32



HI again Bernie

Yes, I had seen the same thread in several different places which is why I thought Marshall's solution was so elegant.

I did just finish trying Aqua's solution on my "practice" machine and it did not work for me. The package using Marshall's approach does work for me and it also works on one of the machines being used by a third party. Both my "practice" machine and the third party machine do not have any version of Access and my ap appears to be working satisfactorily.

Again, whatever works, I only hope that some other people can be helped with what we all have taken the time to offer.

Cheers
Go to the top of the page
 
+
pere_de_chipstic...
post May 12 2012, 05:43 PM
Post #13

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi whatsit

Glad you found a working solution (IMG:style_emoticons/default/thumbup.gif)

The Marshal Barton approach is similar in principle to the method I use (outlined in post #5).

Good luck with your project.
Go to the top of the page
 
+
Aquadevel
post May 15 2012, 08:59 AM
Post #14

UtterAccess VIP
Posts: 6,898
From: Earth...



Hi Guys,

I don't see how 'my' code didn't work.
( I Believe it was Crystal that had originally posted the code I use.)

I've used it for years on boxes running XP, Vista, Win 7 both in full version of A2003 and both Full & RunTime versions of A2007.

But as Whatit said, whatever works for you, and you are satified go with it!

(IMG:style_emoticons/default/notworthy.gif) (IMG:style_emoticons/default/uarulez2.gif)
Go to the top of the page
 
+
pere_de_chipstic...
post May 15 2012, 09:33 AM
Post #15

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi Aqua

I think it was Crystal who originally gave me that same code for the zoombox as well. Subsequently came across this problem via the first link in post #11, though I'd not had any problems until I upgraded an A2003 db to A2007 and a client installed it on a new machine with A007 runtime but that had never had a full version of Access installed.

That may all be coincidentall but something seems to have changed with A2007. Since then I've always used my own homegrown pop up form to emulate the zoombox. (once bitten .... as they say.)

Cheers
Go to the top of the page
 
+
Aquadevel
post May 17 2012, 04:52 PM
Post #16

UtterAccess VIP
Posts: 6,898
From: Earth...




Bernie,

95+% of the boxes that I put Access 2007 have never had full version on them because they are brand new, and lately most are even 64Bit boxes.
Never had an issue with the ZoomMe() method, but will keep an eye out.

Thanks,

(IMG:style_emoticons/default/notworthy.gif)
Go to the top of the page
 
+
pere_de_chipstic...
post May 18 2012, 12:09 AM
Post #17

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi Aqua

You're welcome, but it is quite an odd one. If you come across something more definitive please let me know - I'd really appreciate it. - thanks
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 11:32 AM

Tag cloud: