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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox on form only on specific records

Status
Not open for further replies.

Brlee1crv

Technical User
Apr 10, 2003
96
0
0
US
Greetings,
How can I have a checkbox display on a form only when a specific record comes up. For instance if a user goes through records on a form and any John Smith record is displayed a checkbox will appear.
 
Brlee1crv

If you are going to display / not display a check box for records in a sing form, this is fairly easy.

Use the OnCurrent event procedure, and take advantage of the visible property. You need to test something, based on the current record to decide to toggle the visible property on or off.

If Me.YourTestValue Then
Me.YourCheckBox.Visible = True
Else
Me.YourCheckBox.Visible = False
End If

If you are going to use a contineus form, then the job gets much tougher. Unfortunately, a contineous form will toggle the visibility property for all check boxes on or foff.

A way around this that I have used with some success is to change the CheckBox to a Combo box that uses a value list of True and False, and then uses Conditional Format feature. For example, turn the back groun colour red if True, and green if False.

Richard
 
How are ya Brlee1crv . . . . .

If you have [blue]Access 2K[/blue] or higher, you can use [purple]Conditional Formatting[/purple]. However . . . you wont be able to hide the control, but [purple]you can disable it[/purple] ([purple]that grayed out look & you can't do anything with it[/purple]) . . . .

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

Part and Inventory Search

Sponsor

Back
Top