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
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

bama4954

New Member
Joined
Oct 31, 2018
Messages
35
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
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
871
*Always* copy and paste the actual code, not rewrite it.
What field is Category1 bound to and what is that field type?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,504
Messages
5,602,060
Members
414,498
Latest member
jordanmiller7890

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
Top