Error 3075 Filtering on a form.

Plukey

Board Regular
Joined
Apr 19, 2019
Messages
138
Office Version
  1. 2016
Platform
  1. Windows
I'm assuming its gotta be something with the data format.

VBA Code:
Private Sub cboHull_AfterUpdate()
    Requeryform
End Sub
VBA Code:
Sub Requeryform()
Dim strSQL As String
strql = ""
    If Len("" & Me!cboHull) > 0 Then
    strSQL = " [Hull_PS]= '" & Me!cboHull.Value
End If
    If Len(strSQL) = 0 Then
    Me.FilterOn = False
    Else
    Me.Filter = strSQL
    Me.Filter = True
End If

End Sub
1692050656862.png

1692050671018.png

1692050680990.png

.. possibly. The column I'm trying to filter has to be the Hull with PS. Ive tried a few different options & Im stumped.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Yes,
You start the text field with a ', but do not close it with a ' ? :(
You have to keep them in pairs. Same would apply if it was a date value and #

Debug.Print your sql strings before you use them, to ensure they at least look correct.
 
Upvote 0
Solution
Yes,
You start the text field with a ', but do not close it with a ' ? :(
You have to keep them in pairs. Same would apply if it was a date value and #

Debug.Print your sql strings before you use them, to ensure they at least look correct.
Thanks for the help...!
VBA Code:
= "[Hull] = '" & cboHull.Value & "'"
 
Upvote 0
I tend to use Me to indicate it is a control and not the field.
Also Value is the default property, so I leave that off as well. You do need it for TempVars though. :(
Code:
strSQL = "[Hull] = '" & Me.cboHull & "'"
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,040
Members
449,092
Latest member
ikke

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