Hi guys
I am getting a problem in the loop below. It doesn't display me each person's record. Can anyone please solve my problem.
Thanks![]()
Please Login or Register to view this content.
Aman
Hi guys
I am getting a problem in the loop below. It doesn't display me each person's record. Can anyone please solve my problem.
Thanks![]()
Please Login or Register to view this content.
Aman
Try to use absolute recordset field name instead of index number. For example rs.fields(“User Name”).
I am still a learner.
Hi
I think there is no problem of field names as the code works fine but it displays the result of only one person. Suppose one person has done 10 letters and 2nd person has done 5 letters then the report will display the username,total letters and total time taken to do those letters for one person only and will not display anything for the 2nd person.
I hope anyone can help me in this.
Thanks
Hard to tell as you have not posted all the relevant code but a guess would be that the output sheet being references as ws is not the activesheet where J is being defined.
Hi
Please find below the complete code and put me in the right direction.
Thanks![]()
Please Login or Register to view this content.
Is Sheet3 the active worksheet?
try using the same sheet object
![]()
Please Login or Register to view this content.
After writing ws instead of activesheet, there is no difference in the output. Again one person's record gets displayed and other users records are again not displayed.
I think the loop runs only once thats why only first person's record gets printed. Please can you read the code inside loop again and guide me in this.
Without the data file it is impossible for use to guess what is happening.
What happens when you step through the code line by line.
What are the values of J. Are they correct.
Does the record set really return more than 1 person.
Try adding some debug.print line so you know for sure data is being missed from the worksheet
When I write :
a=rs.recordcount
then it displays me the result -1.
![]()
Please Login or Register to view this content.
don't you need to move through the record set before the recordcount returns meaningful values.
why not for debugging simple debug.print all the information.
Hi Andy
There is a problem in the loop only which displays first record only. As if i write the following code then everything works fine :
Thanks a lot anyway for your help.![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks