troubleshooting Question

Ho do I check null value in a column of a ComboBox?

Avatar of Peter Fors
Peter ForsFlag for Sweden asked on
Microsoft Access
2 Comments1 Solution8 ViewsLast Modified:
Hi
I have code that works well when Me.Kombinationsruta145.Column(8) contains a value.
But if the value in column (8) is Null, my If clause doesnt trap it.
The second part of the "If", after Else is always performed.

How can I stop the code and give the user a message when Me.Kombinationsruta145.Column(8) has a Null value?

I receive this error in line 190
Error 13 (Type mismatch) in procedure Kombinationsruta145_AfterUpdate,line 190

          Dim RecipeInChoosen As Long
          Dim RecipeInTank As Long

140       If (IsNull(Me.Kombinationsruta145.Column(8))) Then
              'Debug.Print Me.Kombinationsruta145.Column(8) & "column 8"
150           DoCmd.OpenForm "WarningOrNoteGeneric"
160           Forms!WarningOrNoteGeneric.TheMessage = "There is no recipe linked to this product in Article Index. Please close Filling Records and update Article index."
170           Exit Sub
180       Else
190           RecipeInChoosen = Me.Kombinationsruta145.Column(8)
200           RecipeInTank = Forms![bryggning tappning från lagertank]![Tappning Ingående batcher i en överföring underformulär].Form![recept]
              'Debug.Print RecipeInChoosen & "In choosen"
              'Debug.Print RecipeInTank & "In Tank"
210       End If

Open in new window

Best
Peter
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros