Joe8915
Registered User.
- Local time
- , 20:07
- Joined
- Sep 9, 2002
- Messages
- 820
Here is the bottom line. What I am trying to accomplish is not having duplicate enteries in a combo box. I think I am close now. Here is what I have so far:
1. Main Form called FrmBatch2b
2. Subform Called TblName subform
Link Master field is ID
Link Child field is Name_ID
In the Subform I have two fields
1. Called Name_ID
2. Called FullName (I have changed Fullname to a combo box)
Control Source is Fullname
Row Source is SELECT TblEmpName.FullName, TblEmpName.Name_ID FROM TblEmpName ORDER BY TblEmpName.FullName;
Row Source Type is Table/Query
I have pasted this code:
Private Sub LastName_BeforeUpdate(Cancel As Integer)
If DCount("*", "[TblEmpName]", "[lastname_ID] = '" & Me.[Lastname_ID] & "'") <> 0 Then
Cancel = True
MsgBox "cannot save duplicate", vbExclamation, "Duplicate"
End If
End Sub
I receive a error Object or class does not support the set of events
1. Main Form called FrmBatch2b
2. Subform Called TblName subform
Link Master field is ID
Link Child field is Name_ID
In the Subform I have two fields
1. Called Name_ID
2. Called FullName (I have changed Fullname to a combo box)
Control Source is Fullname
Row Source is SELECT TblEmpName.FullName, TblEmpName.Name_ID FROM TblEmpName ORDER BY TblEmpName.FullName;
Row Source Type is Table/Query
I have pasted this code:
Private Sub LastName_BeforeUpdate(Cancel As Integer)
If DCount("*", "[TblEmpName]", "[lastname_ID] = '" & Me.[Lastname_ID] & "'") <> 0 Then
Cancel = True
MsgBox "cannot save duplicate", vbExclamation, "Duplicate"
End If
End Sub
I receive a error Object or class does not support the set of events