Connecting Tech Pros Worldwide Forums | Help | Site Map

Displaying Data from a Table into various Textboxes

Member
 
Join Date: Jul 2007
Posts: 41
#1: Aug 29 '07
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's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,001
#2: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


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)>
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#3: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


Quote:

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.
Member
 
Join Date: Jul 2007
Posts: 41
#4: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


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

FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#5: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


:)

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

Quote:

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. ;)
Member
 
Join Date: Jul 2007
Posts: 41
#6: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


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!
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#7: Aug 30 '07

re: Displaying Data from a Table into various Textboxes


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]
Reply


Similar Microsoft Access / VBA bytes