Join table Cannot get record set
I would like to get the records when I type the number into the text1.text. Why I not record found? Field name PLot is a number data type
Code:
Set InfoRS = New ADODB.Recordset
With InfoRS
.ActiveConnection = conn
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "SELECT pemilik.Plot,pemilik.Pemilik1,pemilik.Pemilik2,Tanah.[LUAS (Ha)],Tanah.KOMPARTMEN,Tanah.Blok,Tanah.[NAMA PROJEK],Tanah.Negeri FROM pemilik,tanah where pemilik.Plot = Tanah.Plot order by pemilik.plot asc"
End With
InfoRS.Open "SELECT pemilik.Plot,pemilik.Pemilik1,pemilik.Pemilik2,Tanah.[LUAS (Ha)],Tanah.KOMPARTMEN,Tanah.Blok,Tanah.[NAMA PROJEK],Tanah.Negeri FROM pemilik,tanah where pemilik.Plot = Tanah.Plot and pemilik.Plot = " & Text1.Text & ""
With InfoRS
Text2.Text = .Fields("Pemilik1").Value & ""
Text3.Text = .Fields("Pemilik2").Value & ""
Text19.Text = .Fields("LUAS (Ha)").Value & ""
Combo6.Text = .Fields("NEGERI").Value & ""
Combo7.Text = .Fields("KOMPARTMEN").Value
Combo8.Text = .Fields("BLOK").Value & ""
Combo9.Text = .Fields("NAMA PROJEK").Value & ""
End With
Re: Join table Cannot get record set
I see a .OPEN in the WITH STATEMENT.
And then another .OPEN right after the END WITH.
You code is all messed up - please clean it up.
Then - at the same time - learn to step through code one-line at a time using common debugging techniques. When you do that you also utilize the IMMEDIATE window of the IDE to examine variables contents and such. You can also hover over variables in the code window and the tool tip will show there value.
Learning these techniques will stop you from posting threads on the forum that you can easily fix yourself.
Re: Join table Cannot get record set
Code:
common debugging techniques
How to do that?