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

Command button visible on a value in a combo box

Status
Not open for further replies.

nrugado

Programmer
Dec 10, 2002
42
US
Per a previous posting I was given this code to insert into the on current of a sub form. When I click on a record in the list with a value of 1 the buttons disappear, when I click on a record with the value of 4 the buttons appear. The problem is that the buttons are appearing for all of the records on the form instead of just the ones with the value of 4. Is there a way to specify that the button should only appear on the record that has the value of 4?


Private Sub Form_Current()
If Me!selStatusID = 4 Then
Me!cmdRESPONDTOTECH.Visible = True
Else
Me!cmdRESPONDTOTECH.Visible = False
End If

End Sub
 
Is your Form where the button is in Continuous View ?


Is the Control selStatusID on the Form or on the subForm
( by the way you do not need the Me! bit )



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Well the button is on the Detail Section of the Form

and in continuous view you get to see multiple copies of the Detail Section of the form. The formatting of the Detail Section and everything in it is exactly the same regardless of which instance you look at.

The DATA that appears in BOUND controls will display the contents of the individual underlying records but any UNbound objects will appear exactly the same on each instance of the Detail Section.

If you have code that changes the formatting of object and that code is in the form's On_Current event then the formatting of ALL of the instances of the Design Section will be predicated on the particular record that currently has the focus.

If you want the Button to appear only for a 4 then you need to make the record selectors visible and make the form Single Record view.



Not good news I know - but I hope it helps your understanding of what is going on.









G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top