Hide/unhide button

H

Harmannus

Hallo,

I have a default image, called "MyImage", on all my forms. Can i hide/unhide
this image by changing one parameter in a module (e.g.
me.myimage.visable=false)?

Tried various things but can't get it to work....

Thanx for any tips!


Regards,

Harmannus
 
K

Ken Snell

Depends upon where the code that does this is located. Your code example
would work only in the form's module, not in a regular module. (I'm assuming
that your misspelling of Visible is a typo and not actually in your code).

Please provide more information about what and when and where.....
 
H

Harmannus

Hallo,

Thanx for the reply!

In other words ;-)

On all my form i have a image "MyImage". Can i hide (not visible) or unhide
(visible) this image for "all" my forms by changing 1 parameter through code
in a module?

Hope this is clear...

Regards,

Harmannus
 
K

Ken Snell

You can use a global variable (boolean) that is declared in a regular
module, and then you can set the value of the variable in any other module;
those other modules also can read that variable's value and use it to decide
whether to show the image or not.

However, global variables can be "reset" if an unhandled error occurs in
your code, so you need to be careful with them.

It may be better to use something like a function that returns a True or
False based on some condition....for example, is there some condition that
you use to know whether the image should be visible or not? Assuming that
there is, you can use a Public Function:

Public Function MakeImageVisible() As Boolean
MakeImageVisible = ConditionIsTrue
End Function

Where ConditionIsTrue should be replaced by an expression that gives you a
True or False value based on some condition. You then would call this
function in each of the form's OnLoad event (for example):
Me.ImageName.Visible = MakeImageVisible()

If you can provide more info about how you decide whether to make the image
visible or not, we can probably susggest more specfic info.
 
H

Harmannus

Hallo,

Thanx for the information!

I have hidden full access en limited access buttons on my switchboard with
the below code in a module

Sub SetFullStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change to
name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
End Sub

Sub SetLimitedStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change to
name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
End Sub

I would like to add myimage.visible = true to the full access code and the
myimage.visible=false code to the limited access code.....

Can this be done (with your code)?

Regards,

Harmannus
 
D

Dirk Goldgar

Harmannus said:
Hallo,

Thanx for the information!

I have hidden full access en limited access buttons on my switchboard
with the below code in a module

Sub SetFullStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change
to name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
End Sub

Sub SetLimitedStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning!
Change to name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
End Sub

I would like to add myimage.visible = true to the full access code
and the myimage.visible=false code to the limited access code.....

Can this be done (with your code)?

Regards,

Harmannus

I've been answering this question where you posted it question
independently in a different newsgroup. That's called "multiposting",
and it's generally frowned on because others don't know what answers
have already been given, and so they duplicate the effort. Also it's
harder for you to keep track of the various replies, and it's harder for
later readers of the question, who may be looking for the same answer,
to learn what they need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is
to "crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and
any replies will appear in all the listed newsgroups automatically,
which is beneficial to all concerned.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Hide/unhide image on forms 7
Field TAB color 2
Fixed size but no decimals 2
Message box with number of records? 2
Menubar 2
Remove default menu- and toolbar? 1
Disable edit all but 1 field? 7
Start mdb from mdb 2

Top