Lynn_AccessUser
Registered User.
- Local time
- Today, 01:20
- Joined
- Feb 4, 2003
- Messages
- 125
I have a continuous subform in which I am having troubles keeping the focus on the current record that the user is on. For example, there are 3 records in the subform and the user changes record 2 or 3. The user is then taken back to record 1.
I have used similar code on other forms and can't figure what the difference is that is doesn't work now.
Here is the code:
Dim rs As String
rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID
DoCmd.RunCommand acCmdSaveRecord
Forms!frmCheckInfo!sbfCheckItem!Requery
rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID.SetFocus
DoCmd.FindRecord rs
I put a break on rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID.SetFocus and the rs = correct value
However, when I go to the next line of code:
DoCmd.FindRecord rs
rs = "" and I get the following error msg:
Run-Time error 2142
The FindRecord action requires a Find What argument.
Thanks for the help!!!
I have used similar code on other forms and can't figure what the difference is that is doesn't work now.
Here is the code:
Dim rs As String
rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID
DoCmd.RunCommand acCmdSaveRecord
Forms!frmCheckInfo!sbfCheckItem!Requery
rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID.SetFocus
DoCmd.FindRecord rs
I put a break on rs = Forms!frmCheckInfo!sbfCheckItem!txtCheckItemID.SetFocus and the rs = correct value
However, when I go to the next line of code:
DoCmd.FindRecord rs
rs = "" and I get the following error msg:
Run-Time error 2142
The FindRecord action requires a Find What argument.
Thanks for the help!!!