FuzMic
DataBase Tinker
- Local time
- Today, 15:49
- Joined
- Sep 13, 2006
- Messages
- 719
Hi members
For years i have been at odds to determine the best way using VBA to move around records at an opened form.
To begin, i have problem to identify the current record position form VBA. Actions such as FormName.requery will move it to the first record thus needs handling. To identify the original position of the form, i use the content in a FieldName eg Old$ and then find it as follows:
FormName.FieldName.SetFocus
DoCmd.FindRecord Old$
I feel this is not the best option. I think if we know the original position eg 7 at the form and we can use the following code
DoCmd.GoToRecord acDataForm, "FormName", acGoTo, 7
Q: Is there another smarter way?
Q: How to determine the original position of the form?
Q: In paradox.dos if we are the last or first record, we can determine it by referring its properties eg LastRecord. How do we do this in VBA?
Appreciate advice.
For years i have been at odds to determine the best way using VBA to move around records at an opened form.
To begin, i have problem to identify the current record position form VBA. Actions such as FormName.requery will move it to the first record thus needs handling. To identify the original position of the form, i use the content in a FieldName eg Old$ and then find it as follows:
FormName.FieldName.SetFocus
DoCmd.FindRecord Old$
I feel this is not the best option. I think if we know the original position eg 7 at the form and we can use the following code
DoCmd.GoToRecord acDataForm, "FormName", acGoTo, 7
Q: Is there another smarter way?
Q: How to determine the original position of the form?
Q: In paradox.dos if we are the last or first record, we can determine it by referring its properties eg LastRecord. How do we do this in VBA?
Appreciate advice.