Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Windkyle

4 posts

Wannabe Geek


#31377 15-Mar-2009 23:16
Send private message

I have a database with:
Tables
Contacts {Name, Address, Phone Number, ID} etc
Jobs {Job Number, Name, Adress Phone Number, Job Description} etc

How do I create a JOB form where when I enter the name which is linked to the contacts and the address from that name comes up Automatically.

Create new topic
bitumen
10 posts

Wannabe Geek


  #201371 16-Mar-2009 09:20
Send private message

Tables
Contacts {Name, Address, Phone Number, ID} etc
Jobs {Job Number, Name, Address Phone Number, Job Description}

You need to add a relationship between the tables.
[Contacts] 1 or many [Jobs]
[Jobs] must have 1 [Contact]
(not going to deal with many to many possibility)

Hence:
Contacts {Name, Address, Phone Number, ID} etc
Jobs {Contact_ID, Job Number, Name, Address Phone Number, Job Description}

Contact_ID in the Jobs table is the foreign Key to the Contact table ID field

Sample query (not tested or checked)

Select [Contacts].[Address]
From [Contacts],[Jobs]
Where [Contacts].[ID]=[Jobs].[Contact_ID] And [Jobs].[Name] = input


Hope this helps


edit reason: formating



Ragnor
8221 posts

Uber Geek

Trusted

  #201419 16-Mar-2009 14:26
Send private message

I would imagine you will invariably have a situation where a contact has many jobs and a job can have more that one contact. 

For many to many relationships you just need a joining table like JobContact, eg:

  Contact [ContactID, Name, Address, PhoneNumber, WhenCreated, WhenModified, CreatedBy, ModifiedBy]

   Job [JobID, Name, Adress Phone Number, Job Description, WhenCreated, WhenModified, CreatedBy, ModifiedBy]

   JobContact [JobID, ContactID, WhenCreated, WhenModified, CreatedBy, ModifiedBy]

A couple of coding conventions that I normally stick to are: don't make table names pural, add some basic logging fields so you can at least tell who last modified it and who created it (Created/Modified).

bitumen
10 posts

Wannabe Geek


  #201422 16-Mar-2009 15:07
Send private message


Windkyle You seem to be learning many different technologies and languages and concepts,

I recomment you look at FunctionX website as they have alot (450mb) of tutorials that i think will assist you.

Good luck in the learning!



stevonz
397 posts

Ultimate Geek

Trusted

#201426 16-Mar-2009 15:17
Send private message

Also bytes.com  (formerly know as thescripts.com) is another forum with a wealth of information & quick/ friendly advice relating to MS Access/ Excel queries...




Cheers, Stevo

Windkyle

4 posts

Wannabe Geek


#201514 16-Mar-2009 22:14
Send private message

Yep definately trying to learn as much as possible. Ive recently started my own little PC repair business, im pretty good at Diagnosing problems with hardware and software. This is my website let my know what you guys think, and what do you think it would cost to build it. www.pcworld.co.nz. I really appreciate your guys help Cool

Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.