Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Fields?

Status
Not open for further replies.

Fredofthreads

Programmer
Jul 14, 2009
8
CA
I know that databases are to minimize duplicate information or whatever, but i have a field for supplier and a field for manufacturer and 1 time out of 500 it is different. Is there maybe a function i can use in default value, or something so that i don't need to add the same name twice? Any suggestions would be helpful, Thanks.
 
Presumably you have a table of people (supplier, manuafacturere, etc) and a form for updating?

You can set the manufacturerID to the supplierID in the supplier after update event, or simply leave it null, except where it is not equal to the supplier. You would then use a query (view)* for all forms and reports. It is generally recommended that tables are not used directly, so this is in line with best practice.


------------
*
Code:
SELECT Nz(ManufacturerID,SupplierID,ManufacturerID) As Manufacturer ...

Or

Code:
SELECT IIf(IsNull(ManufacturerID),SupplierID,ManufacturerID) As Manufacturer ...


 
Remou, the correct syntax for NZ:
SELECT Nz(ManufacturerID,SupplierID) As Manufacturer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top