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.




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
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

8034 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).

 
 
 
 


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!

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



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



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Microsoft New Zealand Partner Awards results
Posted 18-Oct-2019 10:18


Logitech introduces new Made for Google keyboard and mouse devices
Posted 16-Oct-2019 13:36


MATTR launches to accelerate decentralised identity
Posted 16-Oct-2019 10:28


Vodafone X-Squad powers up for customers
Posted 16-Oct-2019 08:15


D Link ANZ launches EXO Smart Mesh Wi Fi Routers with McAfee protection
Posted 15-Oct-2019 11:31


Major Japanese retailer partners with smart New Zealand technology IMAGR
Posted 14-Oct-2019 10:29


Ola pioneers one-time passcode feature to fight rideshare fraud
Posted 14-Oct-2019 10:24


Spark Sport new home of NZC matches from 2020
Posted 10-Oct-2019 09:59


Meet Nola, Noel Leeming's new digital employee
Posted 4-Oct-2019 08:07


Registrations for Sprout Accelerator open for 2020 season
Posted 4-Oct-2019 08:02


Teletrac Navman welcomes AI tech leader Jens Meggers as new President
Posted 4-Oct-2019 07:41


Vodafone makes voice of 4G (VoLTE) official
Posted 4-Oct-2019 07:36


2degrees Reaches Milestone of 100,000 Broadband Customers
Posted 1-Oct-2019 09:17


Nokia 1 Plus available in New Zealand from 2nd October
Posted 30-Sep-2019 17:46


Ola integrates Apple Pay as payment method in New Zealand
Posted 25-Sep-2019 09:51



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.

Alternatively, you can receive a daily email with Geekzone updates.