Do While Loop Assistance

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.
 
M

Morten Wennevik

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.
 
C

Chris Dunaway

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.
 
C

Cor Ligthert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top