Solved

DataTable Column/Row Reference

Posted on 2009-05-05
4
393 Views
Last Modified: 2013-11-27
I have a MS Access 2003 query that returns 2 columns and 4 rows, based on the tableadapter parameter in my VB2005 program. I need to have:

textbox1.text = column1, row1
textbox2.text = column2, row1
textbox3.text = column1, row2
textbox4.text = column2, row2
etc. thru
textbox8.text = column2, row4

What is the proper way to reference the data in the table to fill the textboxes?
0
Comment
Question by:Tim313
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
GRayL earned 250 total points
ID: 24304926
A relational database does not work that way.  If you want to be able to refer to the return by row and column, then make the query the record source for a combo box or a list box.  You can refer to the values by:

myVal=Me!cboName.column(c,r)

Where r and c are zero-based rows and columns
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 24305532
You have to SORT the recordset how you wish to view the data.
Scott C
0
 

Author Closing Comment

by:Tim313
ID: 31578025
Did not use the solution, but kept it for future reference....
0
 
LVL 44

Expert Comment

by:GRayL
ID: 24576782
Thanks, glad to help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question