msgbox in index

kiko11

New member
Local time
Today, 06:44
Joined
Jul 12, 2005
Messages
9
I have 2 fealds ( Id and date ) they are primery keys in the table , I want to prevent duplacte id to the same date . ( MSGBOX after update the date )
 
You can't have two primary keys in a table. But you can have a primary key that is made up of two fields. Hold down the Ctrl key and select the two fields you want and then click the primary key button.
 
u r right . i want to show msgbox if the id and date is duplucated .
Thanks
 
Sorry, I don't know if you can trap the duplicate index error. I have tried and failed.
 
If you require a message box then you need to check for duplicates in the before_Update event for the control.
or
if this is the only Jet message to trap, then use the form_error event.
like this:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
msgbox "Your message here"
Response = acDataErrContinue
End Sub
 
Yes I need to check for duplicates ( Id and Date ) if they duplicates the msgbox show
 
The only way to do that is to check BEFORE you are about to do the update. In the BeforeUpdate event, for example.
 
The_Doc_Man said:
The only way to do that is to check BEFORE you are about to do the update. In the BeforeUpdate event, for example.
WHERE IS THE CODE ???
 

Users who are viewing this thread

Back
Top Bottom