473,503 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing form

553 Contributor
If i have to work with a form, do i always have to write all of this code first:

Dim formMe As Form
Set formMe = Forms.Item("frm_sub_search_client")

' then the required work
formMe.Visible = False


Is there any way a form can directly be referenced without needing to declare variables using Set , etc first?
Jul 21 '07 #1
3 1523
nico5038
3,080 Recognized Expert Specialist
Did you try:

Me.visible = false

e.g. in the forms OnOpen event ?

Nic;o)
Jul 21 '07 #2
questionit
553 Contributor
But it will effect the current window.

I am first opening a window from another window:
Call DoCmd.OpenForm("search_customer", acNormal, , , , acWindowNormal)

if i do Me. ---- it will effect the current screen !

so a am looking for command maybe DoCmd or something that will cause effect on some other form/window



Did you try:

Me.visible = false

e.g. in the forms OnOpen event ?

Nic;o)
Jul 21 '07 #3
nico5038
3,080 Recognized Expert Specialist
But it will effect the current window.

I am first opening a window from another window:
Call DoCmd.OpenForm("search_customer", acNormal, , , , acWindowNormal)

if i do Me. ---- it will effect the current screen !

so a am looking for command maybe DoCmd or something that will cause effect on some other form/window
Hmm, in such a case I place the code in the form I open and pass the "action code" by using the OpenArgs of the OpenForm command. (Last parameter)

So on the "opening form code use::
Call DoCmd.OpenForm("search_customer", acNormal, , , , acWindowNormal,"Invisible")

And in the OnOpen event of the "search_customer" use:

If Me.OpenArgs = "Invisible" then
Me.visible = false
else
Me.Visible = True
endif

Getting the idea ?

Nic;o)
Jul 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4709
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text box that references a field on the subform. What I'd like it to do is show the value...
6
2442
by: jstaggs39 | last post by:
I want to create a Dcount and an If...Then...Else statement to count the number of records in a table based on the date that is entered to run the form. The If....Else statment comes in because if...
4
1837
by: mplogue | last post by:
I have a form (frmMain) with a subform (frmSub), each with enumerated fields of the same name (txt1, txt2, etc). I'm trying to make a function that will take the values for each field in frmMain,...
17
18388
by: Paul Helmuth | last post by:
All, (here's an easy one)... This is probably a stupid question - please bare with me as I am new to dotNet. How does one reference objects on a form from a module? In 6.0 you could simply...
2
4041
by: Axel | last post by:
Hi, a question about something that seems very simple at first glance: is it possible to reference other controls of a subform in a query window without referencing through the parent form? I...
9
7352
by: Alan | last post by:
Hmmm, I'm not too good with the syntax of referencing a subreport. I have frmInvoice which has the invoice details (e.g. ProductCode, ProductCost etc) in the subform frmInvoiceDetails. I'm trying...
21
5066
by: cmd | last post by:
I have code in the OnExit event of a control on a subform. The code works properly in this instance. If, however, I put the same code in the OnExit event of a control on a Tab Control of a main...
2
2205
by: ccsnavy | last post by:
For some reason referencing an unbound control on an active form from a query has ceased to work correctly. While other previously existing references to unbound controls in the same form seem to...
11
3497
by: ozTinker | last post by:
I'm sure this shouldn't be too difficult, but I lack familiarity with the MS object model. Suppose I have a table "Purchase_Orders" and a form "TEMP" which I am using to look up a customer's...
0
7093
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
7287
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,...
1
7008
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...
0
7467
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
5594
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,...
0
4688
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...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
399
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...

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.