Detail:On Format visibility question (1 Viewer)

btnel1

New member
Local time
Today, 06:08
Joined
Jul 25, 2019
Messages
4
I saw in these posts info on how to display one field based on another, I've writ the below code, but I'm getting an error that I can't troubleshoot...


Code:
= [field1].Visible = ([field2].Value IN ('AL', 'G1', 'V1'))
[field3].[Visible] = [field1].[Visible]
[field4].[Visible] = [field1].[Visible]


Can anyone help me find the invalid syntax?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:08
Joined
Oct 29, 2018
Messages
21,357
Hi. Where exactly is this code placed? By having an equal sign at the beginning, it looks like it's a Control Source for a Textbox.
 

btnel1

New member
Local time
Today, 06:08
Joined
Jul 25, 2019
Messages
4
I have the code in the Detail, On Format event
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:08
Joined
Oct 29, 2018
Messages
21,357
I have the code in the Detail, On Format event
Okay, can you please post the complete section code? Maybe the syntax error is because of the equal sign at the beginning.
 

btnel1

New member
Local time
Today, 06:08
Joined
Jul 25, 2019
Messages
4
Here is the code, thanks so much!


[no interest 24 term price].Visible = ([Commission Code].Value IN ('AL', 'G1', 'V1'))
[finance label].[Visible] = [no interest 24 term price].[Visible]
[Finance label 2].[Visible] = [no interest 24 term price].[Visible]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:08
Joined
Oct 29, 2018
Messages
21,357
Here is the code, thanks so much!

[no interest 24 term price].Visible = ([Commission Code].Value IN ('AL', 'G1', 'V1'))
[finance label].[Visible] = [no interest 24 term price].[Visible]
[Finance label 2].[Visible] = [no interest 24 term price].[Visible]
Okay, thanks. And you're saying the above is giving you a syntax error, correct? If so, try commenting out the first line and see if the error goes away. If so, then I think the problem is in the IN() part. Try breaking them out separately using an OR construct.
 

Users who are viewing this thread

Top Bottom