if Planning.Bestelbon is not of type "Text", try a type conversion for Me.txtSearch
sql = "SELECT Bestelbon, Productnaam FROM (Planning INNER JOIN Tanks " & _<br><br> "ON Planning.Productcode = Tanks.Productcode) WHERE Planning.Bestelbon = " & clng(Me.txtSearch) & ""
put a breakpoint in your code after the sql instruction and inspect sql string in the direct window.
copy the output in the SQL section of the Query designer and run as a query
when Planning.Bestelbon is of type "Text" then try
sql = "SELECT Bestelbon, Productnaam FROM Planning INNER JOIN Tanks " & _ "ON Planning.Productcode = Tanks.Productcode WHERE Planning.Bestelbon = '" & Me.txtSearch & "'"
MS Help for Access states:
If you use the CloseCurrentDatabase method to close the database that is open in the current instance of Microsoft Access, you can then open a different database without having to create another instance of Microsoft Access.
MS Help states for creating the new...
have a look at Daniel Pinault's excellent paper on Subclassing Forms (w_w_w.devhut.net/microsoft-access-form-subclassing-101/) as an idea. He also provided a youtube video on that topic
Greetings
Bernd
you may use this function provided by ChatGPT:
Public Function ActiveAdapter() As String
'---------------------------------------------------------------------------------------
' Procedure : ActiveAdapter
' Author : ChatGPT modified: bbfromgb
' Date : 19.06.2025
' Purpose : find...
I ran into the truncation problem as well and the only simple but dirty solution for me was to force a 'Home' keystroke after displaying the File Dialogue:
Set objFileDialog = Application.FileDialog(3) ' msoFileDialogFilePicker = 3
objFileDialog.AllowMultiSelect = False
'...