473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to display data from a table using parameter as table name?

Hi,

I have a problem pulling data from a table using the parameter as table name.

I have three tables tbl1, tbl2, tbl3 and I want all the records of the table based on the parameter given.

If tbl2 is given in the parameter, I want all the records from tbl2 to be displayed.

If anyone have any idea about this please help me out.

Thanks,
Rama Kanth
Jun 29 '07 #1
3 1777
MikeTheBike
639 Expert 512MB
Hi,

I have a problem pulling data from a table using the parameter as table name.

I have three tables tbl1, tbl2, tbl3 and I want all the records of the table based on the parameter given.

If tbl2 is given in the parameter, I want all the records from tbl2 to be displayed.

If anyone have any idea about this please help me out.

Thanks,
Rama Kanth
How/where are the table records being displayed and how is the table parameter being selected/specified ?


MTB
Jun 29 '07 #2
missinglinq
3,532 Expert 2GB
I'm afraid you're going to have to be a good deal clearer about exactly what you're trying to do here! Where are you entering/selecting this parameter? How do you want the information displayed; in a form, in a query? Are all these tables set up identically, i.e. do they have all the same fields, with only their data being different?

If the tables' structure are the same, and you want to display them using a single form, you can design your form as you want, using one of the tables as the RecordSource, then delete the RecordSource in Design View. Then, in the Form_Open event you can assign the parameter (table name) to the RecordSource like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.   strRecordSource = YourParameter
  3.   Me.RecordSource = strRecordSource
  4. End Sub
Good Luck!
Jun 29 '07 #3
ADezii
8,834 Expert 8TB
Hi,

I have a problem pulling data from a table using the parameter as table name.

I have three tables tbl1, tbl2, tbl3 and I want all the records of the table based on the parameter given.

If tbl2 is given in the parameter, I want all the records from tbl2 to be displayed.

If anyone have any idea about this please help me out.

Thanks,
Rama Kanth
Pass the Table Name as an Argument to a Sub-Routine:
Expand|Select|Wrap|Line Numbers
  1. Public Sub OpenTheTable(strTableName As String)
  2.   DoCmd.OpenTable strTableName, acViewNormal, acReadOnly
  3. End Sub
To Open a specific Table pass its Name to the Routine:
Expand|Select|Wrap|Line Numbers
  1. Call OpenTheTable("tblYourTableName")
Jun 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
6
by: TS | last post by:
Hi, i have a problem validating xml against schema. I used http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx validator and it says it is fine. Can you tell me why this doesn't work? ...
4
by: CSDunn | last post by:
Hello, I have a combo box (Combo7) that needs to call a function during the After Update event of the combo box. The function resides in an Access 2000 ADP Module called MMAnswerData_code. The...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
1
by: John Phelan-Cummings | last post by:
When I add the name of a new individual in a, bound form, it will not display that person’s name in a label control of a second unbound form. I have a scheduling program that I am working on. ...
3
by: SAL | last post by:
Hi, I have Microsoft Enterprise Library 2005 installed on my local system. I'm developing in C# using Visual Studio 2003 IDE with framework 1.1. I am automating a process that will use a DLL...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
0
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
1
by: gandhi.vishal | last post by:
Hello, I have an issue. I'm not seeing the reportviewer data at all. The column names come up fine but there is no data in the report table. Here is what I'm doing I created a dataset with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.