473,804 Members | 4,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms and Form

Hi everyone !

1) An example from help:

"Each Form object has a Controls collection, which contains all
controls on the form. You can refer to a control on a form either
by implicitly or explicitly referring to the Controls collection. Your
code will be faster if you refer to the Controls collection implicitly.
The following examples show two of the ways you might refer
to a control named NewData on the form called OrderForm:

' Implicit reference.
Forms!OrderForm !NewData

' Explicit reference.
Forms!OrderForm .Controls!NewDa ta

The next two examples show how you might refer to a control named NewData on
a subform ctlSubForm contained in the form called OrderForm:

Forms!OrderForm .ctlSubForm.For m!Controls.NewD ata
Forms!OrderForm .ctlSubForm!New Data"

Why is there a "." character after the name of the main form ? (and
the same with a dot after "Controls" property). It's not a method
or property ... And if you look at other key-word "Form, Report
Properties" there is also an example:

intOrderID = Forms!Orders!Or derDetails.Form !OrderID

And now - there is a "!" - not "." wich is more logical for me.
Why wasn't it this way in the last example ?

And one more thing - I don't understand the meaning of property
"form" - why to refer to itself ? Can't we refer just this way:

Forms!Orders!Or dersDetails!Ord erID ???

If we can do that in this way, why to use "form" property ?

Thanks for all answers.

PS. I use MS Access 2000 version 9.0.2812
Nov 12 '05 #1
4 2420
In many cases, the dot and the bang are interchangable.
In other cases, one or the other is required, and the wrong one won't work.
Personally, I don't get too excited about the theoretical underpinnings; I
just use what works.

As for your question about the Form property, that one IS significant.
Forms!Orders!Or derDetails refers to the subform control, which is located on
the form Orders.
This subform control contains a form, which is accessible using its Form
property.
The controls on the subform belong to this form, not to the subform control.
Although I, too, have seen this form in help files:
Forms!OrderForm .ctlSubForm!New Data
I have never been successful in making it work without referring to the Form
property of the subform control.

Pozdrowienia
- Turtle
"Soryt" <di**@wp.pl> wrote in message
news:br******** **@atlantis.new s.tpi.pl...
Hi everyone !

1) An example from help:

"Each Form object has a Controls collection, which contains all
controls on the form. You can refer to a control on a form either
by implicitly or explicitly referring to the Controls collection. Your
code will be faster if you refer to the Controls collection implicitly.
The following examples show two of the ways you might refer
to a control named NewData on the form called OrderForm:

' Implicit reference.
Forms!OrderForm !NewData

' Explicit reference.
Forms!OrderForm .Controls!NewDa ta

The next two examples show how you might refer to a control named NewData on a subform ctlSubForm contained in the form called OrderForm:

Forms!OrderForm .ctlSubForm.For m!Controls.NewD ata
Forms!OrderForm .ctlSubForm!New Data"

Why is there a "." character after the name of the main form ? (and
the same with a dot after "Controls" property). It's not a method
or property ... And if you look at other key-word "Form, Report
Properties" there is also an example:

intOrderID = Forms!Orders!Or derDetails.Form !OrderID

And now - there is a "!" - not "." wich is more logical for me.
Why wasn't it this way in the last example ?

And one more thing - I don't understand the meaning of property
"form" - why to refer to itself ? Can't we refer just this way:

Forms!Orders!Or dersDetails!Ord erID ???

If we can do that in this way, why to use "form" property ?

Thanks for all answers.

PS. I use MS Access 2000 version 9.0.2812

Nov 12 '05 #2
[...]
The controls on the subform belong to this form, not to the subform control. Although I, too, have seen this form in help files:
Forms!OrderForm .ctlSubForm!New Data
I have never been successful in making it work without referring to the Form property of the subform control.
Does it mean that if I use an expression:

Forms!OrderForm .ctlSubForm!New Data

then I refer to NewData of the main form ?
If it is so, then I get it :D

Thanks for your quick reply.
Pozdrowienia
- Turtle


Również pozdrawiam,
Adrian :)
Nov 12 '05 #3
I have never found the expression
Forms!OrderForm .ctlSubForm!New Data
to be useful for anything.
Forms!OrderForm .ctlSubForm
refers to the subform control;
you can use it to access properties such as Top, Left, which are
common to all controls, as well as specific properties like LinkMasterField s
and LinkChildFields .
In general, these are properties that relate the subform control to
the main form it's sitting on.

Another one of the properties of a subform control is its .Form property.
This is a reference to the form which is contained in the form.
Through this property, you can reference all of the properties of that
form -
including all its controls, its recordset, etc.

To reference the control NewData on the main form, there's no need to make
any reference to the subform control at all -
that would just be
Forms!OrderForm !NewData

HTH
- Turtle
"Soryt" <di**@wp.pl> wrote in message
news:br******** **@nemesis.news .tpi.pl...
[...]
The controls on the subform belong to this form, not to the subform

control.
Although I, too, have seen this form in help files:
Forms!OrderForm .ctlSubForm!New Data
I have never been successful in making it work without referring to the

Form
property of the subform control.


Does it mean that if I use an expression:

Forms!OrderForm .ctlSubForm!New Data

then I refer to NewData of the main form ?
If it is so, then I get it :D

Thanks for your quick reply.
Pozdrowienia
- Turtle


Również pozdrawiam,
Adrian :)

Nov 12 '05 #4
[...]
To reference the control NewData on the main form, there's no need to make
any reference to the subform control at all -
that would just be
Forms!OrderForm !NewData


Thank you for your comprehensive answer.

Regards,

Adrian.

PS. I wonder why Forms!OrderForm .ctlSubForm!New Data
works on my computer ... In my opinion Access should throw
an exception, but it doesn't ... :\
Nov 12 '05 #5

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

Similar topics

6
2872
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and loop through all the forms in a database and pull information about the form (controls and properties). We would need to do the same in our VB.NET project; loop through the project and get the web form's control and property information...
19
4115
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
3
2291
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of master form. Method 2 opens the form but when I right click on the Notify Icon I don't get the context menu that I should be seeing. I can interact with the main form window but I cannot interact with the NotifyIcon. Method 2 gives a object reference...
5
5336
by: ~~~ .NET Ed ~~~ | last post by:
Hi, As you all know when an ASP.NET web form is created that will include web controls and such, it contains a FORM that that identifies the web form and its containing controls. Well, I have a web form who has several other (user & custom) controls, these are enclosed within the standard FORM tag. Additionally *some* of these user controls are actually forms as well. This results into nested Forms.
7
2479
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls each with a couple of controls in them I then rebuilt my project and my new panels and all controls they contained are gone... I've looked through the Auto generated code but don't see anything that looks wrong Any body have any idea why this...
15
2068
by: Joshua Kendall | last post by:
I have a script in which it keeps opening the same form instead of only one instance. I also need help with a form that has a password. Where do I put the actual password? can I use a database for multiple users? opens multiple instances of password form instead of one: Public Class Splash Inherits System.Windows.Forms.Form
7
1523
by: Sergey Poberezovskiy | last post by:
Hi, I created two base forms: frmList and frmDetail, compiled them into a dll, and then want to use in my new project. The problem: When I created new inherited form, say frmClients, I cannot load the form in design view - the IDE complains with "Argument 'Path' is Nothing or empty." error. It does not stop however the project to compile, and even
3
2378
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the error goes away!!! Also I get lots of member not found errors, these however don't stop me from...
13
2953
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the events.. But the regular forms that are also open do not receive that event. This is true whether there are child forms open or not.
21
3393
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.