Question : how to eliminate double input of a value

Hello experts,
once again i need your help.
i have a form that i need to input a selected values daily, but unfortunately it doesn't detect if the value i entered is already duplicate.
Ex.
Report no: 001
Drawing no: XXX
Weld : 001
and
Report No: 002
Drawing: XXX
Weld :001
Now, what i want to do is as soon i type the weld no: 001 from report no: 002 is to alert the user it is already entered on report no: 001 or there will be a message that this weld is already existing. with a reference of the drawing no.

Can you please help me.

Thanks alot.

Czher  

Answer : how to eliminate double input of a value

Here you go... Just manupulate this code for all this you want...

Ad this to AfterUpdate event of report number...
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Dim db As Database
    Dim rs As Recordset

    Set db = CurrentDb
    Set rs = db.OpenRecordset("SELECT [Visrep], [Drgsplno] FROM MAINDB WHERE weld = """ & weld & """ AND Drgsplno = """ & Drgsplno & """ AND [ID] <> " & ID)
    'If weld is a string add as ..Weld = """ & txtNewWeld & """")
    
    If rs.EOF <> True Then
        MsgBox "Weld already exists." & vbCrLf & vbCrLf & "Drawing No = " & rs.Fields("Drgsplno") & vbCrLf & "Report No = " & rs.Fields("Visrep")
        weld.Undo
    End If
    rs.Close
    db.Close
Random Solutions  
 
programming4us programming4us