R
Russell. via AccessMonster.com
Folks,
Going around in circles, maybe trying to do this the wrong way?
I have an MS Access 2007 table which has tenants names in it. If there are
two tenants in one property they have the same contract number.
I am trying to create a macro that looks up a contract number and then
populates two text boxes with First Name, Last Name of Tenant 1 and then goes
to the next record and populates two text boxes with First Name, Last Name of
Tenant 2.
I don't seem to be able to look up the record, and I don't seem to be able to
go to the next record! Here is my Macro code:
GotoControl
[Contract]
FindRecord
"[Contract Number]" **This is a text box where I put in
the contract number**
Whole Field
All
No
All
Yes
Yes
SetValue
[Forms]![Macro Test Form]![FirstName1]
[First Name]
SetValue
[Forms]![Macro Test Form]![LastName1]
[Last Name]
NextRecord
SetValue
[Forms]![Macro Test Form]![FirstName2]
[First Name]
SetValue
[Forms]![Macro Test Form]![LastName2]
[Last Name]
I'd certainly appreciate any assistance anyone can offer me as to where I am
going wrong!
Thanks in advance!
Russell.
Going around in circles, maybe trying to do this the wrong way?
I have an MS Access 2007 table which has tenants names in it. If there are
two tenants in one property they have the same contract number.
I am trying to create a macro that looks up a contract number and then
populates two text boxes with First Name, Last Name of Tenant 1 and then goes
to the next record and populates two text boxes with First Name, Last Name of
Tenant 2.
I don't seem to be able to look up the record, and I don't seem to be able to
go to the next record! Here is my Macro code:
GotoControl
[Contract]
FindRecord
"[Contract Number]" **This is a text box where I put in
the contract number**
Whole Field
All
No
All
Yes
Yes
SetValue
[Forms]![Macro Test Form]![FirstName1]
[First Name]
SetValue
[Forms]![Macro Test Form]![LastName1]
[Last Name]
NextRecord
SetValue
[Forms]![Macro Test Form]![FirstName2]
[First Name]
SetValue
[Forms]![Macro Test Form]![LastName2]
[Last Name]
I'd certainly appreciate any assistance anyone can offer me as to where I am
going wrong!
Thanks in advance!
Russell.