Making a button visible....If

Chimp8471

Registered User.
Local time
Today, 17:24
Joined
Mar 18, 2003
Messages
353
hi i have a search facility on my database,

how it works:-

i have a form called tbl_employee's on this i have a button that is called search when i click search it filters down to the single item selected.

what i want is as soon as the seach button is applied i want a button to be visible, but only if the search button is active.

could someone help me with the code please.

cheers

Andy
 
Not sure what yoiu mean by

"only if the search button is active" What is the definition of active.

You are no doubt aware of using the visible property that could be switched using the On Click property of the search button.

If newbutton.visible=false then
newbutton.visible=true
else
newbutton.visible=false
end if

This will toggle a newbutton visible property on and off

Think you want something more than this however hence the initial question

len B
 
yeah sorry, it didnt sound that clear when i wrote it...

i wan to be able to click on the open search button.......then the button that i want to be visbible/hide will then appear.

but when search option has finished the newly visible button would then hide
 
Len Boorman said:
If newbutton.visible=false then
newbutton.visible=true
else
newbutton.visible=false
end if

This will toggle a newbutton visible property on and off

To make that even shorter:

Code:
NewButton.Visible = Not NewButton.Visible
 
Okay understand things a bit more now.

So the bit of code in the earlier post will make the new button appear, Remember to set its visible proprty to No initially.

Now it really depends what happens when the search option finishes to decide how to switch the button off.

Suppose that the on click property of the search button does something like

Switch on newbutton
do searchy things
update a hidden sub form
make sub form visible with search results

Then you could set focus to the sub form and on the Got Focus property of the sub form have an event that switched of the new button. Would take a little bit of investigation to get the syntax correct.
Would be something like
Mainform!Newbutton.visible=false
Then are some real experts on this on this forum so now doubt someone out these could help if you run into a problem.

What you really need to do is to establish the sequence of events you want to happen and then examine this sequence to determine how/what you can use to trigger next event.
Remember how they climbed Everest......one step after another

Len B
 

Users who are viewing this thread

Back
Top Bottom