D
Dinsdale
Hi guys,
Getting very annoyed with this one. I have previously successfully used code
behind a Close button on a single record form to take me back to the
appropriate record on a list. Code used the FindRecord command to link
between the two forms e.g.
Forms![Employee List].Requery
DoCmd.OpenForm ("Employee List")
Forms![Employee List]![EmployeeID].Visible = True
DoCmd.GoToControl "EmployeeID"
DoCmd.FindRecord Forms![Employee Details]![EmployeeID], acEntire, ,
, , acCurrent
DoCmd.GoToControl "Employee Name"
Forms![Employee List]![EmployeeID].Visible = False
This code works well. So I transferred and modified the code to work in
another database - or so I thought. Here's the modified code:
Forms![CAN6].Requery
DoCmd.OpenForm ("CAN6")
Forms![CAN6]![CANDIDATEID].Visible = True
Forms![CAN6]![CANDIDATEID].SetFocus
DoCmd.FindRecord Forms![CAN2 INPUT]![CANDIDATEID], acEntire, , , ,
acCurrent
Forms![CAN6]!cmdClose.SetFocus
Forms![CAN6]![CANDIDATEID].Visible = False
This code generates the 2162 error - 'A macro set to one of the current
field properties failed because of an error in a FindRecord action argument'.
I have compared field properties until I'm going blind. Any ideas why the
latter code won't work?
TIA
Andrew
Getting very annoyed with this one. I have previously successfully used code
behind a Close button on a single record form to take me back to the
appropriate record on a list. Code used the FindRecord command to link
between the two forms e.g.
Forms![Employee List].Requery
DoCmd.OpenForm ("Employee List")
Forms![Employee List]![EmployeeID].Visible = True
DoCmd.GoToControl "EmployeeID"
DoCmd.FindRecord Forms![Employee Details]![EmployeeID], acEntire, ,
, , acCurrent
DoCmd.GoToControl "Employee Name"
Forms![Employee List]![EmployeeID].Visible = False
This code works well. So I transferred and modified the code to work in
another database - or so I thought. Here's the modified code:
Forms![CAN6].Requery
DoCmd.OpenForm ("CAN6")
Forms![CAN6]![CANDIDATEID].Visible = True
Forms![CAN6]![CANDIDATEID].SetFocus
DoCmd.FindRecord Forms![CAN2 INPUT]![CANDIDATEID], acEntire, , , ,
acCurrent
Forms![CAN6]!cmdClose.SetFocus
Forms![CAN6]![CANDIDATEID].Visible = False
This code generates the 2162 error - 'A macro set to one of the current
field properties failed because of an error in a FindRecord action argument'.
I have compared field properties until I'm going blind. Any ideas why the
latter code won't work?
TIA
Andrew