473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Referring to controls in Modules

PMB
Thank you in advance for any and all assistance. It is greatly appreciated.

I was wondering how do you refer to controls in a Module, in a private or public function?

I've tried Me.ActiveControl and get errors.

Michael
Nov 12 '05 #1
1 3076
PMB wrote:
Thank you in advance for any and all assistance. It is greatly
appreciated. I was wondering how do you refer to controls in a Module,
in a private or public function? I've tried Me.ActiveControl and get
errors. Michael


Code from MSAccess97 help
Sub ActiveObjects()
Dim frm As Form, ctl As Control

' Return Form object pointing to active form.
Set frm = Screen.ActiveForm
MsgBox frm.Name & " is the active form."
' Return Control object pointing to active control.
Set ctl = Screen.ActiveControl
MsgBox ctl.Name & " is the active control " _
& "on this form."
End Sub

You can also pass the control or form to the module
PassIt Me, Me.Text0

Function PassIt(frm As From, txb As TextBox) or
Function PassIt(frm As From, ctl As Control)
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
4
by: MLH | last post by:
Somehow, I seem to be able to refer to combo-box controls in 2 distinctly different ways. A combo-box on an Access 97 form named TagCountyChooserBox seems can be referenced these ways... ...
7
by: Lauren Quantrell | last post by:
At running the risk of asking how big is too big... Is there a rule of thumb or a best practice that says I may have too many modules? I currently have a Access2K app with about 30 code modules,...
0
by: John Bailey | last post by:
I have a web site that is designed similarly to DotNetNuke in that the site has basic functionality, and there are modules (ascx controls) that add additional functionality. I am trying to upgrade...
5
by: John Smith | last post by:
Hello Coould please any one to help me to find good graphical controls to create GDI in ASP.NET. Some related websites also really appreciated Thanks in Advance John
0
by: David Rose | last post by:
I have an existing asp.net web application which contains several user controls. Some of these user controls contain other user controls (generic controls) which are located in a subdirectory. Now...
2
by: Phil | last post by:
Hi all, If I remember correctly, in VB you can refer to your controls from a module simply by referring to ControlContainer, ie. Form1.Textbox1.Text = "something". I have added a module to my...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
2
by: Ing. Davide Piras | last post by:
Hi there, we are rewriting our .NET 1.1 web application with VS. 2005 and .NET 2.0, it takes big work but we believe there is a point to do that... at least we hope! we believe that: 1) the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.