473,382 Members | 1,258 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,382 software developers and data experts.

Database pulling info from 1 of 3 different tables

I am creating a database that will input customer information and part numbers. When I enter a prefix, I want access to look at a specific table and then when I enter the part number I want to to display that data in a label box.

I have the 4 tables created along with the form. How would I go about getting Access to look at either of the tables based on data entered in a seprate text box. I.E.

Prefix...EI (access should now look at table labeled EI not the table labeled LR)
Part Number...2995 (access should now display the description in the label box on the form)
Apr 9 '07 #1
4 1468
ADezii
8,834 Expert 8TB
I am creating a database that will input customer information and part numbers. When I enter a prefix, I want access to look at a specific table and then when I enter the part number I want to to display that data in a label box.

I have the 4 tables created along with the form. How would I go about getting Access to look at either of the tables based on data entered in a seprate text box. I.E.

Prefix...EI (access should now look at table labeled EI not the table labeled LR)
Part Number...2995 (access should now display the description in the label box on the form)
Too little information to attempt a response. Please provide more detail such as: Table and Field Names, Field Data Types, Relationships, allowable Prefixes, Lookup Fields, etc.
Apr 9 '07 #2
My primary table is called Replacement Parts 1
The 3 other tables are called LER Parts, EI Parts, and SFT Parts.
These tables are going to have a part description that I want to be pulled into the form while the user is entering data.

The description fields in al 4 tables ate in TEXT format

There is currently a relationship between the primary table and the EI/LER field and the Part # field.
Apr 10 '07 #3
My primary table is called Replacement Parts 1
The 3 other tables are called LER Parts, EI Parts, and SFT Parts.
These tables are going to have a part description that I want to be pulled into the form while the user is entering data.

The description fields in al 4 tables ate in TEXT format

There is currently a relationship between the primary table and the EI/LER field and the Part # field.
Apr 10 '07 #4
ADezii
8,834 Expert 8TB
My primary table is called Replacement Parts 1
The 3 other tables are called LER Parts, EI Parts, and SFT Parts.
These tables are going to have a part description that I want to be pulled into the form while the user is entering data.

The description fields in al 4 tables ate in TEXT format

There is currently a relationship between the primary table and the EI/LER field and the Part # field.
I still do not have enough information, but here is the basic Logic
Expand|Select|Wrap|Line Numbers
  1. Dim strPrefix As String, strLookupTable As String
  2.  
  3. 'strPrefix = '<some Method to arrive at a Prefix>
  4.  
  5. Select Case strPrefix
  6.   Case "EI"
  7.     strLookupTable = "EI"
  8.   Case "LER"
  9.     strLookupTable = "LER"
  10.   Case "SFT"
  11.     strLookupTable = "SFT"
  12. End Select
  13.  
  14. 'We have the Prefix at this point, obtain the Numeric Part#
  15. Dim intPartNo As Long
  16. 'intPartNo = '<some Method to arrive at a Part#>
  17.  
  18. 'Look up the Description from the appropriate Table
  19. Dim strDescription As String
  20. strDescription = DLookup("[Description]", strLookupTable, "[Part#]=" & intPartNo)
Apr 10 '07 #5

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

Similar topics

6
by: Sarah Tanembaum | last post by:
I was wondering if it is possible to create a secure database system using RDBMS(MySQL, Oracle, SQL*Server, PostgreSQL etc) and web scripting/programming language(Perl, PHP, Ruby, Java, ASP, etc)...
2
by: Rosy Moss | last post by:
I am in the process of cleaning up a database that our company uses to track jobs, time and expense, and customer information. We are running Windows 2000 Server with approximately 20 terminals...
0
by: crjunk | last post by:
Hi, I'm pulling data from 3 different databases into 1 DataSet. Is there a way that I can insert a new field into the DataSet and add a value (such as "MSBA", "AFCA", "AFNAT", etc...) to each...
2
by: mattmerc | last post by:
Hi all, I've searched around on this topic but haven't come up with anything that matches exactly what I am trying to do. I have an ASP .net application running over a SQL database. I need to...
7
by: molemoore | last post by:
Im trying to connect to an Access database using a class. I think I have been able to establish the connection but when trying to test it by pulling data from the database im getting the error: ...
2
by: Jasper Jones | last post by:
Hi, I've designed several Crystal Reports using the built in wizard. They point to my database as HQ which is called "Thom". There is a database called Sales on Thom which all the reports point to...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
7
by: bhipwell via AccessMonster.com | last post by:
Hello, I have developed an employee benefits database that currently contains over 3000 employees and 70+ companies. Having started the database as a really simple solution for our clients, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.