Hello there,
I've one question to make about combo box and null values. Ok, is it possible to let's say set combo box value to null some how? I've tryied to do something with this but I get error message 3058 (Index or primary key cannot contain a Null value) everytime. That combo box is not primary key, but it's indexed, so there can't be same values in that table.
Let me explain a bit more. Ok, I've one combo box which rowsource type is table/query and rowsource is connected to table with ID. I've also checkbox there. What I try to do here is that when I check that box, system will automatically set that combo box value to null, but I can't do this cause I get that error message 3058 (Index or primary key cannot contain a Null value).
All advices etc. are approciated!
Thanks!
I've one question to make about combo box and null values. Ok, is it possible to let's say set combo box value to null some how? I've tryied to do something with this but I get error message 3058 (Index or primary key cannot contain a Null value) everytime. That combo box is not primary key, but it's indexed, so there can't be same values in that table.
Let me explain a bit more. Ok, I've one combo box which rowsource type is table/query and rowsource is connected to table with ID. I've also checkbox there. What I try to do here is that when I check that box, system will automatically set that combo box value to null, but I can't do this cause I get that error message 3058 (Index or primary key cannot contain a Null value).
Code:
Private Sub Card_Returned_AfterUpdate()
On Error GoTo Err_Card_Returned_AfterUpdate
If (Me![Card_Returned].Value = -1) Then
[Forms]![frm_Details]![frm_Details_Sub_Table]![Card_Return_Date] = Now
Me![Card_Return_Date].Requery
Me![Card].Value = ""
Me![Card].Requery
Else
[Forms]![frm_Details]![frm_Details_Sub_Table]![Card_Return_Date] = ""
Me![Card_Return_Date].Requery
End If
Exit_Card_Returned_AfterUpdate:
Exit Sub
Err_Card_Returned_AfterUpdate:
Exit Sub
End Sub
All advices etc. are approciated!
Thanks!
Last edited: