Zoom Box Font

B

Bob

I have used code found in this newsgroup in an A2003 sp3 database on a
split database where the FE and BE reside on a LAN. I have found that
the code works on some text box controls, but not others. The type/
size of the text boxes are identical, but different (of course) field
names. Sometimes, if I include a Debug.Print
Application.Screen.ActiveForm.name in the module the error will go
away (http://groups.google.com/group/microsoft.public.access/
browse_thread/thread/35008de8017c54f7/b069e57054f71093?
hl=en&lnk=gst&q=zoom+box+font+#.) .

The code in my forms:

Private Sub cc2_DblClick(Cancel As Integer)
MyZoom
End Sub

A module's public code:
Public Function MyZoom()
'========================================================================
' Procedure : MyZoom
' Purpose : Uses the Access Utility reference to set font size zoom
boxes.
' Font size stored in s_settings table. Variable bytFontSize is
assigned
' the font value and used in the UTILITY call.
' Author : Bob Orta
' Phone : 916-350-8846
' Email: (e-mail address removed)
' DateTime : 4/9/2009 14:16
' Notes : Utility reference must be selected in Tools/References.
' Calls : See Below
'-------------------------------------------------------------------------
'Revision History
'========================================================================
Dim bytFontSize As Byte

On Error GoTo MyZoom_Error
bytFontSize = dbLookup("ZoomBoxFontSize", "SELECT ZoomBoxFontSize
FROM s_settings;")

utility.zoom_iFontSize = bytFontSize
' Debug.Print Application.Screen.ActiveForm.name
Call Application.Run("UTILITY.BuilderZoom", _
Application.Screen.ActiveForm.name,
Application.Screen.ActiveControl.name, _
Application.Screen.ActiveControl.Value)

ExitHere:
Exit Function

MyZoom_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") " _
& "in procedure MyZoom of Module basMiscFunctions MyZoom"

End Function

Any ideas why this is happing?

Thanks for looking.
Bob
 
J

Jeanette Cunningham

Hi Bob,
Here is the setup I use for a zoom box.
It is adapted from a sample created by mvp Armen Stein.

I have a standard module with global constants.
It includes a constant for my zoom box-->
Public pctlZoomspaceSource As Access.Control
-----------------------------------

I have a form called frmZoom, below is the code for its Load event.
-------------------
Private Sub Form_Load()

Dim ctl As Control

'Import data into zoomspace
Me!txtZoomspace = pctlZoomspaceSource

End Sub
-------------

Below is the code on the dbl click event of controls that opens the zoom
box.

If Len(Me.ControlName & vbNullString) > 0 Then
Zoomspace Me.ActiveControl
End If

I would be interested to see if the above system solves your problem.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeanette Cunningham

Here is the public sub that you also need for this zoom box.

Public Sub Zoomspace (ctl as Control)
Set pctlZoomspaceSource = ctl

DoCmd.OpenForm "frmZoom", WindowMode:=acDialog

If IsLoaded("frmZoom") Then
pctlZoomspaceSource = Forms.frmZoom.txtZoomspace
DoCmd.Close acForm, "frmZoom"
End If
End Sub


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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