Displaying Data from a Table into various Textboxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cloh
    New Member
    • Jul 2007
    • 41

    Displaying Data from a Table into various Textboxes

    I have a table stored in Access with 2 columns and 9 rows. In my form, I have created 9 textboxes, and I want to display all the values in the 2nd column row by row i.e. txt1 should show row1,column2; txt2 should show row2, column2; txt3 should show row3, column2 etc.

    I used the table as the control source but the problem is that EACH textbox shows the first value of the second column - then when I scroll through the record (using the buttons on the bottom left) it changes ALL of the boxes and updates with the 2nd row etc.

    Please let me know if this is not clear... I am still new to this. Thanks in advance.
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    You have inadvertently posted your question in the Articles section rather than in the Forum section of our site, so I have moved it across to the Forum for you.

    Welcome to TheScripts!

    Linq ;0)>

    Comment

    • FishVal
      Recognized Expert Specialist
      • Jun 2007
      • 2656

      #3
      Originally posted by cloh
      I have a table stored in Access with 2 columns and 9 rows. In my form, I have created 9 textboxes, and I want to display all the values in the 2nd column row by row i.e. txt1 should show row1,column2; txt2 should show row2, column2; txt3 should show row3, column2 etc.

      I used the table as the control source but the problem is that EACH textbox shows the first value of the second column - then when I scroll through the record (using the buttons on the bottom left) it changes ALL of the boxes and updates with the 2nd row etc.

      Please let me know if this is not clear... I am still new to this. Thanks in advance.
      Hi, cloh.

      You don't need to have 18 textboxes to display 9 records of 2-field table.
      Just create a form with 2 textboxes bound to correspondent table fields. If you want to see records on a grid just set form DefaultView property to DataSheet.

      BTW the easiest way to create a form is to choose a table/query and click on [Autoform] button. You will get a form properly linked to the table/query with a full set of controls bound to correspondent table/query fields.

      Good luck.

      Comment

      • cloh
        New Member
        • Jul 2007
        • 41

        #4
        Hi FishVal,

        Thanks for the reply. The thing is, I want to see all 9 values at once, so that the user of the form can change them if they are wrong. I've tried to include a picture of the form - the textboxes I refer to are in the bottom right corner. Maybe I am going about this in totally the wrong way... I just wanted to have the form show:

        Offset
        Location1: [textbox]
        Location2: [textbox]
        Location3: [textbox]
        Location4: [textbox]
        Location5: [textbox]
        Location6: [textbox]
        Location7: [textbox]
        Location8: [textbox]
        Location9: [textbox]

        with each textbox having a default value that the user can change if circumstances alter. The table I have in Access is set up similarly to the layout above - this is what I meant about just showing the values in the second column. Thanks for your time

        [IMG]C:\Documents and Settings\e48234 7\Desktop\pictu re of form.bmp[/IMG]

        Comment

        • FishVal
          Recognized Expert Specialist
          • Jun 2007
          • 2656

          #5
          :)

          I'd like to bring you to my previous post.

          Originally posted by me
          If you want to see records on a grid just set form DefaultView property to DataSheet.
          If you anyway prefer to see it as TextBoxes simply set form DefaultView property to ContinuousForms .

          Never ever you should have a separate textbox for each record. ;)

          Comment

          • cloh
            New Member
            • Jul 2007
            • 41

            #6
            Thanks, FishVal! I think I get what you mean now. When I am in Form view, I get an error message saying I have to switch to Design view to set it to Continuous view... but I don't see this option when I am in Design View. I'll continue fiddling with this, but thanks for telling me about Continuous view - I've never heard about it before!

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              Not a problem.
              • open the form in design view
              • press F4 to open properties window
              • in properties window make sure you're viewing Form properties (topmost combo)
              • on page [Format] find property [Default View] and set it to [Continuous Forms]

              Comment

              Working...