473,378 Members | 1,407 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,378 software developers and data experts.

Which form is the "Current Form"?

MLH
Suppose that code running on FormB
is moving the focus around on FormA
to various textbox controls on FormA -

Which form is the current form during this process?
Is it FormA, which has the focus. Or is it FormB,
whose code is doing the work?
Jun 16 '06 #1
2 12110
The form with the focus is the current form.

Jun 16 '06 #2
Not sure that "current form" is clear nomenclature.

The form that has the focus is the active form.
You can determine this with:
Screen.ActiveForm.Name
A line of code such as:
RunCommand acCmdSaveRecord
would be applied to the active form.

But each form's module is directly associated with that form, so Me gives
you a reference to the form and its properties, controls, methods, etc. So:
Me.Dirty = False
saves the record in this particular form, whether it has focus or not.

So, if you want to write code that applies to this form (whether it is the
active form or not):
Use Not
=== ===
Me.Filter = ... DoCmd.ApplyFilter ...
DoCmd.Close acForm, Me.Name DoCmd.Close
[any form-specific code] DoCmd.DoMenuItem
Me.RecordsetClone.FindNext DoCmd.FindNext
Me.[Text0].Setfocus DoCmd.GotoControl ...
and so on.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:vm********************************@4ax.com...
Suppose that code running on FormB
is moving the focus around on FormA
to various textbox controls on FormA -

Which form is the current form during this process?
Is it FormA, which has the focus. Or is it FormB,
whose code is doing the work?

Jun 17 '06 #3

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

Similar topics

2
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? ...
14
by: Don G | last post by:
Within the menu for my site, I have inserted 'class="current"' within the link for the current page. So the link looks somthing link: <li><a href="index.php" class="current">Home</a></li> The...
3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
5
by: John Oliver | last post by:
I'd like the email produced by FormMail to show a specific From: address rather than postmaster@server.host.name Googling isn't helping me... not sure what to look for :-( -- * John Oliver ...
3
by: RR | last post by:
I have a button on a form (form A) that opens another form. The form that opens (form B) has a listbox that is populated with a call to a function in the "on current" event. When form B with the...
8
by: Jeremy | last post by:
If we have a table with say 3 rows in it and one of the columns contains a checkbox such as <table> <tr> <td><input type="checkbox" name="ch_fld"></td> </tr> <tr> <td><input type="checkbox"...
6
by: KiwiGenie | last post by:
Hi..I am trying to make a search form. I am fairly new to access and could well be looking at it completely wrong. I have an unbound form with textboxes in the header for entering different search...
3
by: Bob Cohen \(106531\) | last post by:
I want to define some metadata using custom attributes to apply to properties in various classes. The properties return values that are classes themselves. I want to retrieve the attribute...
3
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ......
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.