By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,662 Members | 1,765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,662 IT Pros & Developers. It's quick & easy.

Referencing form

100+
P: 553
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
Share this Question
Share on Google+
3 Replies


nico5038
Expert 2.5K+
P: 3,072
Did you try:

Me.visible = false

e.g. in the forms OnOpen event ?

Nic;o)
Jul 21 '07 #2

100+
P: 553
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
Expert 2.5K+
P: 3,072
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

Post your reply

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