Using VBA Query and passing data to different text boxes on form

  • Thread starter tobesurveyor via AccessMonster.com
  • Start date
T

tobesurveyor via AccessMonster.com

Good morning,

I am creating a dynamic form based upon different tasks that I may have in a
query. I have several text boxes on the form: txtTaskNo01, txtTaskNo02,
txtTaskNo03, ect...

I have created a query in the forms On Timer event which is passed through an
ADO command and everything works great. I am trying to find the most
efficient way to move through each row until EOF and pass the information to
each text box.

I think it will need to be something like this:

intCount = 1
Do Until rsMySFR.EOF

txtTaskNumber = rsMySFR.Fields("TaskNumber")

<This is where I am not sure. How can I pass the above info to the text box
txtTaskNo01 and then loop through the remainder of the txtTaskNo02 thru
txtTaskNo10?>

intCount = intCount + 1
rsMySFR.MoveNext

Loop


Any help in this would be greatly appreciated
Thank you in advance,
Chris F
 
K

kingston via AccessMonster.com

To set a field in the form, use something like:

Me.txtTaskNo01 = rsMySFR.Fields("TaskNumber")

To check if a control is populated (so you don't overwrite it):

If (IsNull(Me.txtTaskNo01) = False) Then ...

I'm not sure I follow your logic but I think the above will help.
 

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