Make field not visible depending on another field
Thijs Geeris
Hello,A question about making fields not visible depending on another field.
In the footer area I have to fields.
Field1. A data field that has a text from the texttable in the value > LD.Txt.U0000134
Field2. A data field that has a Value from the database > GetData("B1_Data.Document.U_ZAfm") in the Value property.
If Field2 is empty I don't want to show Field1 (the label). Below the code that I put in the generatescript of Field1. When I run the report it doesn't work. What do I do wrong? Do I have to use the Visible property of Field1? Or something else.
If GetData("B1_Data.Document.U_ZAfm")= "" Then
Sizes.Value = ""
Else
Sizes.Value = GetData("LD.Txt.U0000134")
End If
More details. Field1 has the Name Sizes and Field2 is a alphanumeric field in the database.
Thanks Thijs
Philipp Knecht
Hi ThijsMaybe its because If U_ZAfm contains the Value DBNull in the Database.
If so [quote]If GetData("B1_Data.Document.U_ZAfm")= "" Then will fail because DBNull cannot be compared.
Try with : Data("B1_Data.Document.U_ZAfm")
hth
Thijs Geeris
Thanks for the answer.The solution wasn't the NULL value but replacing the GetData("B1_Data.Document.U_ZAfm") for this Data("B1_Data.Document.U_ZAfm")
Thijs
Philipp Knecht
Hi ThijsGlad it worked out.
Then it was the NULL Value :)
Because Data("...") automatically translates DBNull to "" (in case of alphanumeric fields) which GetData("...") doesn't.
hth
0
Please sign in to leave a comment.
Comments
0 comments