loop through textbox in form

M

mike

Hi all

I have a form which is set as a continuous form. In my
detail section I have, let say 5 textboxes. Is there a way
to loop through each textbox and display what they are,if
a simple msgbox is used.

I create a button on the form header and the code behind
that button is MsgBox txtBox1. Everytime I click it, it
always gives me the first record of the detail section. I
want to have all 5 of them pop up (a loop of msgbox so
that each time I press ok on the msgbox, the next msgbox
would display record 2 and so on.)

Any suggestions??

thanks

mike
 
S

Sandra Daigle

Sure, I have to admit that I don't know why you'd *want* to do this but
here's the code - using the recordsetclone . . .

with me.recordsetclone
if not (.eof and .bof) then
.movefirst
do until .eof
msgbox .fields("MyField")
.movenext
loop
endif
end with
 

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