I am using an Access form that has a text box called – “Me.txtboxOwner_Addr” which displays owner information from a field called “Owner_Addr“ in a MS SQL database table “Apts”. This same record has another field “PRIMARYOWNERRECORD” that is "false". I want to pull out the “ID” number for another record that has the same “Owner_Addr” information but has the field “PRIMARYOWNERRECORD = true”.
I want to put that ID info in a text box called Me.Text196. “ID” is numerical, Owner_address is string, PRIMARYOWNERRECORD is “yes/no”.
I used the following DLookup function but it always returns “ID”= 1 which is not correct. Do I have the syntax wrong?
This is my code:
Me.Text196 = DLookup("ID", "Apts", (Me.txtboxOwner_Addr.VALUE = Owner_Addr) And (PRIMARYOWNERRECORD = True))
Thanks
REW2009
I want to put that ID info in a text box called Me.Text196. “ID” is numerical, Owner_address is string, PRIMARYOWNERRECORD is “yes/no”.
I used the following DLookup function but it always returns “ID”= 1 which is not correct. Do I have the syntax wrong?
This is my code:
Me.Text196 = DLookup("ID", "Apts", (Me.txtboxOwner_Addr.VALUE = Owner_Addr) And (PRIMARYOWNERRECORD = True))
Thanks
REW2009