I am really stuck and can't find an answer for this and would appreciate some guidance. I have a field in a form txtQtyTray and if I have a numeric value in that field my VBA code below works.
When I change the control source on the txtQtyTray field to =[cboPartNumber].[column](2) my code stops working and I get "Not Enough" for every permutation. When I output the value to the screen(like below), it is showing a numeric value, so cant figure out the issue.
From what I am seeing online referencing the combobox in the VBA is what I should do but this doesn't work, i.e. I change txtQtyTray to Me.cboPartNumber.Column(2). Other post reference using .value in Me.cboPartNumber.Column(2) but that seems to break the code completely no matter where I put the .value into.
Thanks in advance.
P.S> My end code wont be showing messages like above, it will trigger something else, but I put the Msgbox in to try and troubleshoot.
Code:
If Me.txtQtyTray.Value = Me.txtCount.Value Then
MsgBox "Full " & Me.txtQtyTray & " is equal to " & Me.txtCount
ElseIf Me.txtCount >= Me.txtQtyTray Then
MsgBox "Too much " & Me.txtCount & " is greater than or equal to " & Me.txtQtyTray
ElseIf Me.txtQtyTray >= Me.txtCount Then
MsgBox "Not Enough " & Me.txtQtyTray & " is greater than or equal to " & Me.txtCount
Else
MsgBox "Something is Wrong"
End If
When I change the control source on the txtQtyTray field to =[cboPartNumber].[column](2) my code stops working and I get "Not Enough" for every permutation. When I output the value to the screen(like below), it is showing a numeric value, so cant figure out the issue.
Code:
MsgBox "Number of items in Tray " & Me.cboPartNumber.Column(2)
From what I am seeing online referencing the combobox in the VBA is what I should do but this doesn't work, i.e. I change txtQtyTray to Me.cboPartNumber.Column(2). Other post reference using .value in Me.cboPartNumber.Column(2) but that seems to break the code completely no matter where I put the .value into.
Thanks in advance.
P.S> My end code wont be showing messages like above, it will trigger something else, but I put the Msgbox in to try and troubleshoot.