Read Data from Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shimul
    New Member
    • Nov 2008
    • 28

    Read Data from Table

    Hi,

    Have table with data ( like a,b,c,d in column 1), want to read data from table and put in text box in continuous form.

    like tble name "tbltest" and textbox name "txtbox".

    now want to read first data from table and put in text box, then read second one and put in text box .....so on unit finish data in table.

    Try to write following code, but couldn't fiqure out ----" New in VBA"
    Code:
    Set db = CurrentDb()
    Set rsLoc = db.OpenRecordset("tbltest", DB_OPEN_TABLE)
    'Loop through records
    rsLoc.MoveFirst
    While Not rsLoc.EOF
    
    txtbox =
    Thx

    *Please check attachment*

    Last edited by NeoPa; Apr 4 '09, 10:23 AM. Reason: Please use the [CODE] tags provided
  • DonRayner
    Recognized Expert Contributor
    • Sep 2008
    • 489

    #2
    Hi Shimul,

    What you are trying to do is going to cause you problems. With continuous forms only the select record is the current one. Therefor if you step through a recordset to update one of the textbooks you will only be updating the current record over and over again. Can you provide some more details in what you are trying to accomplish and maybe we can offer some alternatives.
    Last edited by DonRayner; Apr 3 '09, 10:25 PM. Reason: Must of forgot to type part of my sentence

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      You've inadvertently posted this in the "Insights" section of the Access forum! I'll move it now to the "Answers" section.

      Linq ;0)>

      Moderator

      Comment

      Working...