By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,137 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,137 IT Pros & Developers. It's quick & easy.

Navigating records on form

100+
P: 553
We can navigate records with Navigate Buttons on the form.

How can i do a similar thing with my own code. The requirement is to write a functionality to loop through all the rcords on form ?

Thanks
Qi
Aug 31 '07 #1
Share this Question
Share on Google+
5 Replies


100+
P: 553
We can navigate records with Navigate Buttons on the form.

How can i do a similar thing with my own code. The requirement is to write a functionality to loop through all the rcords on form ?

Thanks
Qi
Experts are boycotting me or they just dont have answers to my 3 un-answered questions or my questions dont make any sense?
Sep 3 '07 #2

Expert 100+
P: 126
Experts are boycotting me or they just dont have answers to my 3 un-answered questions or my questions dont make any sense?
You never stated what you want to do with these records. If they need to be displayed on the form, that's different from looping through them all and updating them.
To loop through records:
Expand|Select|Wrap|Line Numbers
  1. Dim rs as DAO.recordSet
  2. Set RS = DBEngine(0)(0).openRecordSet("SELECT * FROM theTable;")
  3. Do While Not rs.EOF
  4.      'rs!<attribute> can be referenced here, for any attribute
  5.      rs.MoveNext
  6. Loop
  7.  
Sep 3 '07 #3

100+
P: 553
Hi Stwange

I was not asking how to navigate records in table.

Once the records have been loaded onto a form (mine is a continous form), how would you navigate records on the form. I know there are navigate buttons but my requirement is to do something similar of my own.

Could anyone also tell me when we have records loaded on a continous form and we navigate through them using navigate buttons, is each record at that time fetched again from the table/query?

Would we be able to loop through the records on the continous form by some method?

Thanks
Qi



You never stated what you want to do with these records. If they need to be displayed on the form, that's different from looping through them all and updating them.
To loop through records:
Expand|Select|Wrap|Line Numbers
  1. Dim rs as DAO.recordSet
  2. Set RS = DBEngine(0)(0).openRecordSet("SELECT * FROM theTable;")
  3. Do While Not rs.EOF
  4.      'rs!<attribute> can be referenced here, for any attribute
  5.      rs.MoveNext
  6. Loop
  7.  
Sep 3 '07 #4

P: 47
Hi Stwange

I was not asking how to navigate records in table.

Once the records have been loaded onto a form (mine is a continous form), how would you navigate records on the form. I know there are navigate buttons but my requirement is to do something similar of my own.

WHY?
Sep 6 '07 #5

100+
P: 553
Hi

there could be many reasons for doing that.

I have a continous and when records are displayed, i want a check-box to use to select any record. If you select more than 1 check-box, you would still finally get only 1 record selected (I think the last or the first of the records that you select).

Thats why i want a mehtod for looping through records on a continous form (Once records are loaded on the form - not when loading them from table!)

Qi
Hi Stwange

I was not asking how to navigate records in table.

Once the records have been loaded onto a form (mine is a continous form), how would you navigate records on the form. I know there are navigate buttons but my requirement is to do something similar of my own.

WHY?
Sep 6 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.