Beach Access Software
bchacc at san.rr.com
Tue Nov 28 00:05:17 CST 2006
A.D.:
Thanks for that function. My Chinese distributor wants to be able to make
demo systems over there. I want to let them make demos only from the very
restricted 35 part version. So if the 35 part limit label is visible in the
mde, I will let the program run which creates an encrypted key with a thirty
day limit.
This will solve the problem.
Thanks and regards,
Rocky
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.TEJPAL
Sent: Monday, November 27, 2006 9:50 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Checking control property in an external mde database
Rocky,
For accessing control's properties, the form has to be open either in
design or run time view. In case of mde, design view is ruled out.
Function Fn_IsControlVisibleInExternalDb() as given below, will get you
the visible status of desired control in external db. Though it involves
opening & closing of target form in external db, the process remains
invisible to the user.
Note - If the target form is in datasheet view, mere checking of visible
property does not conclusively establish whether the column in question is
displayed or not. For that, ColumnHidden property has to be verified.
Interestingly, ColumnHidden property is detectable only at run time (not in
design view).
Best wishes,
A.D.Tejpal
----------------
=====================================
Function Fn_IsControlVisibleInExternalDb( _
ByVal FilePath As String, _
ByVal FormName As String, _
ByVal ControlName As String) As Boolean
' Returns True if the control is visible.
' Otherwise False
On Error GoTo ErrTrap
Dim acp As Access.Application
Fn_IsControlVisibleInExternalDb = False ' Default
Set acp = New Access.Application
acp.OpenCurrentDatabase FilePath
acp.DoCmd.OpenForm FormName
If acp.Forms(FormName)(ControlName).Visible _
= True Then
Fn_IsControlVisibleInExternalDb = True
End If
acp.DoCmd.Close acForm, FormName
ExitPoint:
On Error Resume Next
acp.Quit
Set acp = Nothing
On Error GoTo 0
Exit Function
ErrTrap:
MsgBox "Err " & Err.Number & " - " & Err.Description
Resume ExitPoint
End Function
=====================================
----- Original Message -----
From: Beach Access Software
To: 'Access Developers discussion and problem solving'
Sent: Saturday, November 25, 2006 19:38
Subject: [AccessD] Checking control property in an external mde database
Dear List:
Is it possible to check the visible property of a control on a form in
another database which is an mde? Would it be necessary to have that
database is currently open with that form opened?
MTIA
Rocky
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.19/555 - Release Date: 11/27/2006
6:09 PM