Forum Discussion

TonyAdrian's avatar
TonyAdrian
Copper Contributor
Jul 13, 2020

MS Access Record Source is not working - but does work on earlier version of Access.

I have a free text search using the following code based on input into a textbox (T9):

Dim SString As String
Dim strText As String

If IsNull(Me.T9) Then
Exit Sub
End If

strText = Me.T9.Value
SString = "Select * From TblOrdersQ Where (([TeamName]Like ""*" & strText & "*"") " _
& " Or ([Batch_ID] Like ""*" & strText & "*"") " _
& " Or ([Part_ID] Like ""*" & strText & "*"") " _
& " Or ([MyProfileDescript] Like ""*" & strText & "*"") " _
& " or ([MyAlias] Like ""*" & strText & "*"") " _
& " or ([BoxTypeID] Like ""*" & strText & "*"")) "
Me.RecordSource = SString

 

I have used this exact same code on many MS Access databases but for some reason, when I created a new one in Office 365 this code does not work. However, on another machine, with Access 64 bit it works just fine. As well, other MS Access databases I created over the past two years have the same code and the same set up to search via textbox entry - all work just fine. Any ideas?

 

This is used to search a continuous form. The back end data is stored in SQL Server. The form is bound to a Select query (TblOrdersQ) in Access.

No RepliesBe the first to reply

Resources