Getting #Type! Error in textbox - Access VBA

bama4954

New Member
Joined
Oct 31, 2018
Messages
35
It works for the 1 and 2 but not the WJ



Private Sub Report_Load()
'TAG 1
If (CategoryStr) = "1" Or (CategoryStr) = "2" Or (CategoryStr) = "WJ" Then
Me.BoxMaxGap1.Visible = False
Else
Me.BoxMaxGap1.Visible = True
End If
End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Sorry this is the correct code I meant to post:

'TAG 1
If (Me.Category1) = "1" Or (Me.
Category1
) = "2" Or (Me.
Category1
) = "WJ" Then
Me.BoxMaxGap1.Visible = False
Else
Me.BoxMaxGap1.Visible = True
End If
 
Upvote 0
*Always* copy and paste the actual code, not rewrite it.
What field is Category1 bound to and what is that field type?
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top