No I usually work with unbound forms.
Someone also suggested this change,
dubbel = "Bestelbon = "' & Me.txtBestelbonNew & '"
How is your suggestion different?
I have following code that gives me error 3464 "type mismatch criteria".
I am certain it has the do with this line,
dubbel = "Bestelbon = " & Me.txtBestelbonNew.Value
The value in the textbox is saved as short text in the table. I've tried to put in in single quotes, double quotes. But...
Damn, you were right about the single quotes. It is a number stored as short text.
But first time I typed the single quotes in the wrong order.
It works now!
Thx a lot
I actually got this code from a query that does work. But when I try to adapt it to vba I now get error "3464 data mismatch in criteria"
Here is my full code,
Private Sub cmdSearch_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sql As String
If...
I'm trying to do a lookup in vba with sql where I search for the value of a textbox in two linked tables.
sql = "SELECT Bestelbon, Productnaam FROM Planning INNER JOIN Tanks " & _ "ON Planning.Productcode = Tanks.Productcode WHERE Planning.Bestelbon = " & Me.txtSearch & ""
But I can't seem to...