hotmalepiyush
Registered User.
- Local time
- Today, 07:42
- Joined
- Jun 3, 2008
- Messages
- 60
hello,
i am having a strange problem
i have table with PK: name+phone number.
i have a form which has a combo box and a subform
combo box is used to select a name...
on updation of this combo box the subform finds related details..
when i click on any textbox to update etc.. i get an error "index or primary key cannot contain a Null value.
also suppose there are more than 1 person called jim.. then i cannot go to next record.. as the same error msg keeps popping.
next when i try closing this form i get an error message saying u cannot record this record.
i no where try to add any new record to my table
please suggest what might be possibly wrong
here's the code i am using on the cobo box:
i am having a strange problem
i have table with PK: name+phone number.
i have a form which has a combo box and a subform
combo box is used to select a name...
on updation of this combo box the subform finds related details..
when i click on any textbox to update etc.. i get an error "index or primary key cannot contain a Null value.
also suppose there are more than 1 person called jim.. then i cannot go to next record.. as the same error msg keeps popping.
next when i try closing this form i get an error message saying u cannot record this record.
i no where try to add any new record to my table
please suggest what might be possibly wrong
here's the code i am using on the cobo box:
Code:
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from FairDB"
LSQL = LSQL & " where Name = '" & cboSelected & "'"
Form_FindByName.RecordSource = LSQL
End Sub
Private Sub cboSelected_AfterUpdate()
'Call subroutine to set filter based on selected CustomerID
SetFilter
End Sub
Private Sub cmdClose_Click()
'Close form
DoCmd.Close
End Sub
Private Sub Form_Open(Cancel As Integer)
'Call subroutine to set filter based on selected CustomerID
SetFilter
End Sub