I have read several posts on this forum about this problem, but none of the solutions presented so far help me.
I have a combo box w/ three columns in it (2 of which are invisible). When a user enters data in the combo box, the other two columns are used to update info in other fields. The combo box represents the company name a person works for. If the person quits working there, but wants to stay on our mailing list as an individual, they would no longer have data in the company field, so it would need to be deleted. Of course when it is deleted, we get this error:
You have tried to assign the null value to a variable that is not a variant data type.
I'm assuming because there is no event to address what to do with the other two columns of information?
So I figured, if i have a "blank" record in the combo box recordsource, users can select the blank record, but I have to figure out a way to idiot-proof it also. Basically, I figured, if I use something like the following code, I could set the combo box to the blank record value behind the scenes when necessary.
Note: "0" is the Id of the "blank" dummy record in my combo box
If Me.OrgName Is Null Then
Me.OrgName.Column(0) = "0"
Me.OrgName.Column(1) = ""
Me.OrgName.Column(2) = ""
Any ideas on how to make this work?
I have a combo box w/ three columns in it (2 of which are invisible). When a user enters data in the combo box, the other two columns are used to update info in other fields. The combo box represents the company name a person works for. If the person quits working there, but wants to stay on our mailing list as an individual, they would no longer have data in the company field, so it would need to be deleted. Of course when it is deleted, we get this error:
You have tried to assign the null value to a variable that is not a variant data type.
I'm assuming because there is no event to address what to do with the other two columns of information?
So I figured, if i have a "blank" record in the combo box recordsource, users can select the blank record, but I have to figure out a way to idiot-proof it also. Basically, I figured, if I use something like the following code, I could set the combo box to the blank record value behind the scenes when necessary.
Note: "0" is the Id of the "blank" dummy record in my combo box
If Me.OrgName Is Null Then
Me.OrgName.Column(0) = "0"
Me.OrgName.Column(1) = ""
Me.OrgName.Column(2) = ""
Any ideas on how to make this work?