Sub all()
        connection()
        Dim see = "Select * from info where Last Name = '" & txtLast.Text & "' and First Name = '" & txtFirst.Text & "'"
        dcom = New OleDbCommand(see, dcon)
        dcom.ExecuteScalar()

        If dcom.ExecuteScalar > 0 Then
            Dim gather = "Select * from info where Last Name = '" & txtLast.Text & "' and First Name = '" & txtFirst.Text & "'"
            dcom = New OleDbCommand(gather, dcon)
            dr = dcom.ExecuteReader
            dr.Read()

            If dr.HasRows Then

                Dim last = dr(1)
                Dim first = dr(2)

                MsgBox("The name" & last + first & "already exists!")


                dcon.Close()
            End If
        Else
            borrower()


        End If
    End Sub
  • Whenever I click the button for saving. it always says "Syntax error (missing operator) in query expression" What will I do? :|

What do you mean by that? I'm only connecting it to MS Access. Can you explain further more. Sorry I'm just a newbie here. :)

This article has been dead for over six months. Start a new discussion instead.