Do While Loop Assistance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Public Function which requires 2 parameters.
Public Function X (ByVal FirstParam as String, ByVal SecondParam as String)
This function displays various options for the 2 parameters(delete, open,
etc..) along with the options "Exit" and "View More".

Here's where I'm stuck...
Prior to calling the function, I fill a dataset with an undetermined amount
of records. I need to then pass the first 2 records of the dataset into the
Function. If the user selects "View More" from within the Function, the next
2 records from the dataset are passed into the function. If the user selects
"Exit" from within the Function., the process stops. What is the best way to
accomplish this? I'll obviously need to use some type of Do...While
statement to loop through the dataset records, but I can't seem to think past
this point. What is the best way to accomplish this? Thanks.
 
Hi MrMike,

Why use a loop? Store the current row number and update the display based
on that.

Then again, I may have misunderstood your function as it appears to be
very odd.
 
One possible way would be to use a funtion that returns a boolean. If
the return is True, then you pass the next 2 records into the function.
If False, then you exit the loop.

Hope this helps a little.
 
Mike,

It completly depends from what you want to do with those rows.

To say it in otherwords how are you showing those rows.

Cor
 
Back
Top