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

A new question with lookups

I'm beginning to understand a little about lookups, but just a little.
Here's another question I'm wondering about.
I want to input a part# and then input a department code (G,D,B) and
depending on the department code have Access find the corresponding file to
lookup. In other words I could have a scenario like this
Part# Department# lookup File
123456 G C:\File1
123456 D C:\File2
123456 B C:\File3
So basically I have 3 differeent "lookup" files for each part# but which
file that pops up is determined by the Department code.
How would I make this happen?
Thanks for your help,
Don..............
Nov 13 '05 #1
5 1490
You need a table with the 3 fields you suggested: PartNo, DeptNo, and
LookupFile. For the LookupFile, you could us a Hyperlink type field. If
that's new, see:
Introduction to Hyperlink fields
at:
http://members.iinet.net.au/~allenbrowne/casu-09.html

In your data entry form, it's easy to choose the file that goes into the
hyperlink field, but right-clicking, using the Insert menu, or you could put
a command button beside the text box, with these 2 lines in its Click event
procedure:
Me.[LookupFile].SetFocus
RunCommand acCmdInsertHyperlink

If you want to programmatically fire up the hyperlink file, use
FollowHyperlink.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Don Sealer" <vz******@verizon.net> wrote in message
news:233yd.6243$152.2248@trndny01...
I'm beginning to understand a little about lookups, but just a little.
Here's another question I'm wondering about.
I want to input a part# and then input a department code (G,D,B) and
depending on the department code have Access find the corresponding file
to
lookup. In other words I could have a scenario like this
Part# Department# lookup File
123456 G C:\File1
123456 D C:\File2
123456 B C:\File3
So basically I have 3 differeent "lookup" files for each part# but which
file that pops up is determined by the Department code.
How would I make this happen?
Thanks for your help,
Don..............

Nov 13 '05 #2
On Wed, 22 Dec 2004 00:18:06 GMT, "Don Sealer" <vz******@verizon.net>
wrote:
I'm beginning to understand a little about lookups, but just a little.
Here's another question I'm wondering about.
I want to input a part# and then input a department code (G,D,B) and
depending on the department code have Access find the corresponding file to
lookup. In other words I could have a scenario like this
Part# Department# lookup File
123456 G C:\File1
123456 D C:\File2
123456 B C:\File3
So basically I have 3 differeent "lookup" files for each part# but which
file that pops up is determined by the Department code.
How would I make this happen?
Thanks for your help,
Don..............

l

Hi
part = 1234 'say
dept = "A" 'say

criterion = "[Part#]=" & part & " AND [Department#]='" & dept & "'"

lookupfile = Dlookup("[lookup File]", "yourtablename", criterion)

Hope no typos! Note in the "where clause" text items are put in single
quotes and numbers not.

David
Nov 13 '05 #3
I've been struggling with this. I'm new at most of this and so I'm not
sure it's not working because I don't understand how to do what you tell me
or because I didn't explain what I want to do very well. In either case
please forgive me for not getting it. Hopefully I will eventually. Let me
try to explain what I'm trying to do a little better.
In my form I'd like to have people enter a part number, choose which
department/operation is appropriate and then have a hyperlink file pop up.
This file would have drawing information and work procedures in it. The
problem I'm stuck on is, each part number is unique, each part number is
associated with three departments/operations, and each department/operation
has it's own unique drawing for that part number. So how could I make a
form work in which I would input the part#, choose the dept/oper and have
the drawing for that part# and dept/oper pop up?
One side note: I already use the DLookup function to populate a field
called Part Desc. It works like this, when I input a Part# it looks up the
description for that Part# and populates the field called Part Desc.
Hope that doesn't confuse things,
Thanks for all your help,
Don...............
This is an short example of what the options would be
Part # Dept/Oper Drawing
135 B Dwg A
135 G Dwg B
135 D Dwg C
246 B Dwg D
246 G Dwg E
246 D Dwg F
103050 B Dwg G
103050 G Dwg H
103050 D Dwg I
204060 B Dwg J
204060 G Dwg K
204060 D Dwg L
etc etc etc

"David Schofield" <d.***************@blueyonder.co.uk> wrote in message
news:41ca970c.615595980@localhost...
On Wed, 22 Dec 2004 00:18:06 GMT, "Don Sealer" <vz******@verizon.net>
wrote:
I'm beginning to understand a little about lookups, but just a little.
Here's another question I'm wondering about.
I want to input a part# and then input a department code (G,D,B) and
depending on the department code have Access find the corresponding file tolookup. In other words I could have a scenario like this
Part# Department# lookup File
123456 G C:\File1
123456 D C:\File2
123456 B C:\File3
So basically I have 3 differeent "lookup" files for each part# but which
file that pops up is determined by the Department code.
How would I make this happen?
Thanks for your help,
Don..............

l

Hi
part = 1234 'say
dept = "A" 'say

criterion = "[Part#]=" & part & " AND [Department#]='" & dept & "'"

lookupfile = Dlookup("[lookup File]", "yourtablename", criterion)

Hope no typos! Note in the "where clause" text items are put in single
quotes and numbers not.

David

Nov 13 '05 #4
I'm really pretty naive about these things. I posted this message to a newwgroup and when I went searching online I find it posted here. So with that in mind here's my next question on this. Although it will probably post here from the newsgroup anyway.
I've been struggling with this. I'm new at most of this and so I'm not
sure it's not working because I don't understand how to do what you tell me
or because I didn't explain what I want to do very well. In either case
please forgive me for not getting it. Hopefully I will eventually. Let me
try to explain what I'm trying to do a little better.
In my form I'd like to have people enter a part number, choose which
department/operation is appropriate and then have a hyperlink file pop up.
This file would have drawing information and work procedures in it. The
problem I'm stuck on is, each part number is unique, each part number is
associated with three departments/operations, and each department/operation
has it's own unique drawing for that part number. So how could I make a
form work in which I would input the part#, choose the dept/oper and have
the drawing for that part# and dept/oper pop up?
One side note: I already use the DLookup function to populate a field
called Part Desc. It works like this, when I input a Part# it looks up the
description for that Part# and populates the field called Part Desc.
Hope that doesn't confuse things,
Thanks for all your help,
Don...............
This is an short example of what the options would be
Part # Dept/Oper Drawing
135 B Dwg A
135 G Dwg B
135 D Dwg C
246 B Dwg D
246 G Dwg E
246 D Dwg F
103050 B Dwg G
103050 G Dwg H
103050 D Dwg I
204060 B Dwg J
204060 G Dwg K
204060 D Dwg L
etc etc etc

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #5
On Fri, 24 Dec 2004 13:11:56 GMT, "Don Sealer" <vz******@verizon.net>
wrote:
I've been struggling with this. I'm new at most of this and so I'm not
sure it's not working because I don't understand how to do what you tell me
or because I didn't explain what I want to do very well. In either case
please forgive me for not getting it. Hopefully I will eventually. Let me
try to explain what I'm trying to do a little better.
In my form I'd like to have people enter a part number, choose which
department/operation is appropriate and then have a hyperlink file pop up.
This file would have drawing information and work procedures in it. The
problem I'm stuck on is, each part number is unique, each part number is
associated with three departments/operations, and each department/operation
has it's own unique drawing for that part number. So how could I make a
form work in which I would input the part#, choose the dept/oper and have
the drawing for that part# and dept/oper pop up?
One side note: I already use the DLookup function to populate a field
called Part Desc. It works like this, when I input a Part# it looks up the
description for that Part# and populates the field called Part Desc.
Hope that doesn't confuse things,
Thanks for all your help,
Don...............
This is an short example of what the options would be
Part # Dept/Oper Drawing
135 B Dwg A
135 G Dwg B
135 D Dwg C
246 B Dwg D
246 G Dwg E
246 D Dwg F
103050 B Dwg G
103050 G Dwg H
103050 D Dwg I
204060 B Dwg J
204060 G Dwg K
204060 D Dwg L
etc etc etc

"David Schofield" <d.***************@blueyonder.co.uk> wrote in message
news:41ca970c.615595980@localhost...
On Wed, 22 Dec 2004 00:18:06 GMT, "Don Sealer" <vz******@verizon.net>
wrote:
>I'm beginning to understand a little about lookups, but just a little.
>Here's another question I'm wondering about.
>I want to input a part# and then input a department code (G,D,B) and
>depending on the department code have Access find the corresponding fileto >lookup. In other words I could have a scenario like this
>Part# Department# lookup File
>123456 G C:\File1
>123456 D C:\File2
>123456 B C:\File3
>So basically I have 3 differeent "lookup" files for each part# but which
>file that pops up is determined by the Department code.
>How would I make this happen?
>Thanks for your help,
>Don..............
>
>l

Hi
part = 1234 'say
dept = "A" 'say

criterion = "[Part#]=" & part & " AND [Department#]='" & dept & "'"

lookupfile = Dlookup("[lookup File]", "yourtablename", criterion)

Hope no typos! Note in the "where clause" text items are put in single
quotes and numbers not.

David

Hi
I think you should just have a table with columns

Part Dept Drawing Filename
135 B Dwg A aaaa
135 G Dwg B bbbb
135 D Dwg C cccc
246 B Dwg D dddd

Part and Dept form the key

then you have a form with combo boxes to select Part and Dept, and
show the corresponding other columns (and open the file).
That way you don't need dlookup at all.

It is a good general rule that you don't need Dlookup if the criteria
come from a query, as you could have added the field to be looked up
to the query via an extra join if necessary.

David

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Logan | last post by:
Hello, I am trying to construct a query across 5 tables but primarily 3 tables. Plan, Provider, ProviderLocation are the three primary tables the other tables are lookup tables for values the...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
1
by: Russell | last post by:
Hi, I've been reading a lot about not using lookups in tables lately. Thus far, what I've been able to understand from my reading is this: - Do not use lookup fields in tables because they...
4
by: Don Sealer | last post by:
I have a form that is based on a table called CVA Defects Table. Three of the fields in the table and form are Oil line defects, Gas line defects, and Sub assembly defects. These fields use...
5
by: AnAnimal | last post by:
We are moving a rather large application to the VB.NET platform. This application has a ton of table lookups. ie. code & description or code, category & description or code, class, category &...
12
by: bcr07548 | last post by:
I am writing a web site that uses JavaScript to validate certain forms and I seem to be having some trouble. The site uses PHP and for one of the forms, depending on the situation, one of of the...
6
by: mac | last post by:
Summary: 1. I want to define a column in anMS Access table to be lookups on other tables. 2. The table that is the data source (e.g the "parent" table) has a composite primary key. 3. When...
35
by: bukzor | last post by:
I've found some bizzare behavior when using mutable values (lists, dicts, etc) as the default argument of a function. I want to get the community's feedback on this. It's easiest to explain with...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.