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!

Make Combo Box Visible 1

Status
Not open for further replies.

McHooty

Technical User
May 23, 2011
6
GB
Hi

I have the following code as an After Update Event Procedure to make one of four optional text boxes visible on my form. This works ok and I can enter data into the text box.

My problem is that when I navigate away from the record and return later the text box is no longer visible (but if I re-select the option from the combo box it re-appears with the corect data).

Any ideas on where i am going wrong ?

Private Sub Acquisition_Method_ID_AfterUpdate()

With Me.Loan_No
Select Case Me.Acquisition_Method_ID.Value
Case 1 'Loan
.Visible = True
Case 2 'Donation
.Visible = False
Case 3 'Bequest
.Visible = False
Case 4 'Purchase
.Visible = False

End Select
End With

With Me.Donation_No
Select Case Me.Acquisition_Method_ID.Value
Case 1 'Loan
.Visible = False
Case 2 'Donation
.Visible = True
Case 3 'Bequest
.Visible = False
Case 4 'Purchase
.Visible = False
End Select
End With

With Me.Bequest_No
Select Case Me.Acquisition_Method_ID.Value
Case 1 'Loan
.Visible = False
Case 2 'Donation
.Visible = False
Case 3 'Bequest
.Visible = True
Case 4 'Purchase
.Visible = False
End Select
End With

With Me.Purchase_No
Select Case Me.Acquisition_Method_ID.Value
Case 1 'Loan
.Visible = False
Case 2 'Donation
.Visible = False
Case 3 'Bequest
.Visible = False
Case 4 'Purchase
.Visible = True
End Select
End With

End Sub
 

Have you tried putting similar code in the forms On_Current event? As it stands, there is nothing to indicate any status other than your defaults.


Randy
 
Hi randy700

Thanks for the benefit of your experience - works as required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top