Find Same Name and Show Text Box

qwerty99

Registered User.
Local time
Today, 15:58
Joined
May 7, 2013
Messages
41
I have two different fields in 2 tables, ICname and WCname, and if there is an instance where they are the same I need to have a textbox on the main form show "Same Name" but if not the box should remain invisible.

I have created a query that searches through all the names and only prints out those that have the same name in each table, but I don't know where to go from here, and I'm not even sure how to do this conceptually. Is using a query the right way to go about doing this?

Any thoughts on how to do this?
 
If the two fields are in the form's source:

=IIf(ICname = WCname, "Same Name", "")
 
What if the fields are not in the form's source? The two fields are from different tables and are not related to each other in any way, I just need to know a way of showing if they have the same name. Its unlikely/will be rare to have the names the same, but I still need a way to show if they are.

Thanks again!
 
Yes, that is what I'm trying to do. I put the following code in, but its not working:

Code:
Iff(DCount("WCAccountName","WCInfoT","WCAccountName=ICBusName")>0, "Same Name", "")

It keeps telling me "Compile Error: Expected: ="

Where WCAccountName is in the table WCInfoT, and I'm comparing WCAccountName to ICBusName, which is the IC name located in the form?

What am I missing to implement this?
 
Where exactly do you have it, and try with the correct function (IIF, not IFF)?
 
I have it in the On Current event for the form.
 
In VBA you'd have to be setting something to that value:

Destination = Value
 
I'm sorry I'm still a novice at VBA, but what do you mean by that? Which value?
 
I would try it as the control source of a textbox on the form.
 

Users who are viewing this thread

Back
Top Bottom