View Single Post
  #1 (permalink)  
Old September 16th, 2003, 09:21 PM
elleetan elleetan is offline
Registered User
 
Join Date: Sep 2003
Location: , , Singapore.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to elleetan Send a message via MSN to elleetan Send a message via Yahoo to elleetan
Default how to create duplicate error message???

i have 3 tables which name "TerminalFault" and "terminalFAultDEtail" and "TerminalFaultType"

for "TerminalFault" table, it is alos the main form call(FrmFAult) , it has 3 fields which are:
1)Fault date, datatype = date/time , indexed = no
2)Serial NUmber, datatype = text , indexed = yes(duplicate ok)
3)FaultNUmber(primary key), datatype = text , indexed = yes(duplicate no)

for "terminalFaultDetail" table, it is also the subform attahed on the mainform call(subform1), it has the fields
call:
1) LinkId(primary key), datatype= aoutonumber, indexed = yes(no duplicate)
2)FaultNumber (which is link to the TerminalFault table's field FaultNUmber), datatype = text , indexed = no
3) FaultLink ,datatype = Number, indexed = yes(duplicate ok),
Which is link to other table(TerminalFaultType)'s fields call "Fault".

for "TerminalFaultType" table, it has 2 fields:
1)LinkID, datatype= autonumber, indexed = yes(no duplicate), which is link to "terminalFaultDetail"'s fields(FaultLink)
2)Faultdesc, datatype=text , indexed = no


from these table , i had created one main from and a subform from above tables except the TerminalFaultType



i think it is more clearer with this explaination:

The realtionship between the FaultNumber field in TerminalFAult to TerminalFAultDEtial is one to many.
here is the form that i had created:
Main forn(FrmFAult) has:
1)Faultdate:
2) Serial NUmber
3)FaultNumber

subform(subform1):
1)FaultNUmber which is link to the mainform "FaultNumber" many to one
2)Fault(which is choose from the other table call TErminalfaultDetail)

this is my form looks like:
eg,
MAin form:
FaultDate : 1/1/2003
Serial NUMber : 22
FaultNUmber: A001

subform:
""""can have multiple faultnumber and Fault:
FaultNUmber : A001 Fault: F1
FaultNUmber: A001 FAult: F2
FAultNUmber: A001 FAult: F3


eg2, FaultDate : 1/1/2003
Serial NUMber : 22
FaultNUmber: A002

subform:
""""can have multiple faultnumber and Fault:
FaultNUmber : A002 Fault: F1
FaultNUmber: A002 FAult: F2
FAultNUmber: A002 FAult: F3


what i want is with the on the subform same FaultNumber, it cannot have same FAult:
example:
FaultDate : 1/1/2003
Serial NUMber : 22
FaultNUmber: A003

subform:
""""can have multiple faultnumber and Fault:
FaultNUmber : A003 Fault: F1
FaultNUmber: A003 FAult: F2
FAultNUmber: A003 FAult: F1 (i want to create duplicate value error to inform user that there shouldnt be duplicate cos it is duplicate the first Fault which is the first row" faultNUmber = A003 and Fault = 1"



Hope i wiould not confused you. I will appreciate your help! tHank you