Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Control in Continuous Forms

Status
Not open for further replies.

ragu111

MIS
Aug 15, 2002
129
AE

in my Continuous Forms i have below items

Command1
Command2
CheckBox

i need on Command1 Click
CheckBox = Tick (Yes)
Hide Command1

i need on Command2 Click
CheckBox = Un-Tick (No)
Hide Command2

i want this function to happen on for the selected record.

ragu[pc]
 

Are the "tick-boxes" bound controls?
Do you have the command buttons on every record or are they in the header/footer?


Randy
 
ragu
The problem you are probably encountering is that you can't hide a control while it has the focus.

So, your code behind the OnClick event for Command1 would be something such as...
Code:
Me.CheckBox.SetFocus
Me.CheckBox = True
Me.Command1.Visible = False
Me.Command2.Visible = True

When you click Command1, you shift the focus to the check box, and then you can hide Command1...but you will also want to be sure that Command2 is visible, in case you are toggling back and forth between these command buttons.

The code behind the OnClick event for the second command button would be...
Code:
Me.CheckBox.SetFocus
Me.CheckBox = False
Me.Command2.Visible = False
Me.Command1.Visible = True

Tom



 
Tom
the code is working fine, but the problem when the button visible = false all the button on the Continuous Forms goes hidden. i want to hide the buttom only for the selected row/record.

ragu[pc]
 
How are ya ragu111 . . .

This is typical behavior of a control in the detail section of a continuous form. Your best option is to use [blue]conditional formatting[/blue] but there are restrictions:
[ol][li]You [blue]can't set conditional formatting[/blue] for a command button. However you can use textboxes and make them look just like a command button. Using the textbox method you'll have [blue]the unwanted changing of the mouse pointer into the Ibeam when selecting.[/blue][/li]
[li]You can't hide, but you can [blue]disable[/blue] the textboxes (that grayed out look).[/li]
[li]Wether this can be done is dependent on wether the checkbox is bound (already inquired by [blue]randy700[/blue]). This question needs to be answered![/li][/ol]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top