I have an Access database program that I am currently
rewriting in VB and SQL Server. I'm trying to take the
Access query information and build code in VB. I'm new to
VB and SQL. I viewed the Access Query in SQL view and I
got the following:
SELECT PLATS.*, PLATS.[LIBER/PAGE]
WHERE (((PLATS.[LIBER/PAGE])=[ENTER LIBER/PAGE L44/100-
CONDO NO L420]));
I want the user to be able to type a number in an input
box. The following is the code I wrote in VB:
Private Sub cmdSrchNo_Click()
Dim cnnConnection As ADODB.Connection
Dim rstPlatLiber As ADODB.Recordset
Dim strQuery As String
Dim lngRecCount As Long
prompt$ = "Enter the Liber/Page (L1/1) or Condo No.
SearchStr$ = InputBox(prompt$, "Liber/Page or Condo No.
strQuery = "SELECT PLATS.*, PLATS.[LIBER/PAGE]" & _
"From PLATS" & _
I didn't include the rest of the code for space. I get an
error whenever I try to execute this. Is my SQL SELECT
statement correct? I would appreciate any help.