Query - Access - Match Names

  • Thread starter Thread starter tcooper007
  • Start date Start date
T

tcooper007

Guest
Quick question… I am trying to accomplish something that I believe it is fairly simple. At least in Excel, it is. I have two tables with names. I am trying to create a formula that will compare name in table 1 with a name in table 2. If the names match (exact matches only) it will let me know. Something like =IF (NAME1=NAME2,”TRUE”,”FALSE”) in Excel. I have trying using Iif, but it returns that I cannot divide by zero. I have linked the tables, so if I query NAME 1 and NAME 2, it will only display names on table 1 that are found on table 2.
Any help would be appreciated.
Thanks,
 
Actually, I think things got a little bit easier. I have written a module that asks for the name, then with the query the name is matched against the table that I need. I was able to add the query shortcut to the form, but would like to know if I could create a module that would pull the name written on the textbox on the form. Then when I run the query from the form, it will pull the name from the text box and match against a specific table.
The module right now is:

Function GetName() As String

GetName = InputBox("Enter The Name here: ")

End Function

The form is called Table1, and the field is called Name.

Help?! :)
 
way to complicated. your method seems to be an over kill.

just create a query, and in design view create an inner join. you add table1.names and table2.names. in criteria you write Is Null. thats it. i think there is a help file on this.

sam
 
SamDeMan said:
way to complicated. your method seems to be an over kill.

just create a query, and in design view create an inner join. you add table1.names and table2.names. in criteria you write Is Null. thats it. i think there is a help file on this.

sam

Thanks. I can't make it work though... the only thing it does is display on the names from table 1 and the names found on table 2. I am trying to narrow down to a specific name... so if that name is entered on the form, the query can try to match the name against a "black list".. which is table two.
Thanks,
 
try this:

use a combo box and make it have two columns. the data will be from table/query and datasource invoke the query builder. there you can make up your query. you will have two fields selected, first is from tabel1.names and the second table2.names. then create another textbox with the controlsource =ComboboxName.Colomn(1)
(remember the colmns start from 0)
this should work.
sam
 

Users who are viewing this thread

Back
Top Bottom