I need to compare the contents of two text fields.

  • Thread starter Thread starter Frank Martin
  • Start date Start date
F

Frank Martin

Access2000 / WindowsXP
Can someone help me with some code to compare two text fields.

On my report I have two text fields which sometimes contain identical
strings.

(This is because I have used one table twice in a query, one as an alias.)

I want the code to suppress the printing of the second text field when this
one is the same as the first.

The text fields are:
"CustName"
"AddressName"

and so the code might go like this.....

if
"CustName" = "AddressName"
then
Me.AddressName.Visible = False
end if

Can someone help me with the correct method?
Regards Frank
 
Thank you.
Your's didn't work until we changed it to:

If Me.CustName = Me.AddressName Then
Me.AddressName.Visible = False
Else: MeAddressName.Visible = True
End If

It all works fine now.
Thanks again, Frank
 
Sorry: you're right that unless you're resetting the visibility elsewhere,
you'd need to handle it there.
 
Back
Top