Making Fields Visible on Subform

rjf3123

Registered User.
Local time
Yesterday, 23:27
Joined
Oct 4, 2003
Messages
25
Folks -
Thanks so far for all the assists out there ... Am learning quite a bit and have been using this forum as a reference to get through some issues.

Here's one I cannot quite figure out.

I have a form [Details] which has a Subform [PaymentInfo].
the fields on the [PaymentInfo] Subform are all set to "visible=no"

On the Details form, I have a field [FeeElection] which can be one of three percentages. After I enter the percentage in this field, I want certain fields on the subform to become visible, depending on the value of the [FeeElection] field.

This is the code I put in the "On Lost Focus" for the FeeElection field (which isn't working):

Select Case Me.FeeElection
Case 0.5
[PaymentInfo].[Field1].Visible = False
[PaymentInfo].[Field2].Visible = False
[PaymentInfo].[Field3].Visible = True
Case 0.4
[PaymentInfo].[Field1].Visible = True
[PaymentInfo].[Field2].Visible = False
[PaymentInfo].[Field3].Visible = True
Case Else
[PaymentInfo].[Field1].Visible = False
[PaymentInfo].[Field2].Visible = False
[PaymentInfo].[Field3].Visible = False
End Select
End Sub

I am sure it is a syntax error on my part (probably trying to reference the field on the subform).

Can someone out there set me straight?

TIA -
R. Fisher
 
It is a syntax problem. Presuming FeeElection is on the main form, try this:

Me!PaymentInfo.Form!Field1.Visible = False
 
Thank You Paul!, Knew it had to be something simple. I moved the code to the On Current for the Details form itself (rather than the On Got Focus for the FeeElection field) and it works like a charm!

Thanks Again -
R. Fisher
 

Users who are viewing this thread

Back
Top Bottom