Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. No value given for ine or more given requirements

No value given for ine or more given requirements

Scheduled Pinned Locked Moved Database
businesshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jlawren7
    wrote on last edited by
    #1

    heres the statement Private Sub CmdSQL_Click() Dim strSearchLName, strSearchFName As String strSearchLName = txtSearchLName.Text strSearchFName = txtSearchFName.Text adoRecords.RecordSource = "Select * FROM Users Where (Last_Name) = '" & strSearchLName & "' AND (FName) = '" & strSearchFName & "' " the varibles are getting the correct information. if i search with 1 varible, there isn't a problem. Any ideas??? here are the order of steps: user enters their first name & Last Name into text boxes. they click a button a screen pops up, showing their contact info. then the log in form shows and they need to click th log in button right now, all the contacts in the contacts table are showing but if i search with only the last name, it only shows the correct contact in the form.

    E 1 Reply Last reply
    0
    • J jlawren7

      heres the statement Private Sub CmdSQL_Click() Dim strSearchLName, strSearchFName As String strSearchLName = txtSearchLName.Text strSearchFName = txtSearchFName.Text adoRecords.RecordSource = "Select * FROM Users Where (Last_Name) = '" & strSearchLName & "' AND (FName) = '" & strSearchFName & "' " the varibles are getting the correct information. if i search with 1 varible, there isn't a problem. Any ideas??? here are the order of steps: user enters their first name & Last Name into text boxes. they click a button a screen pops up, showing their contact info. then the log in form shows and they need to click th log in button right now, all the contacts in the contacts table are showing but if i search with only the last name, it only shows the correct contact in the form.

      E Offline
      E Offline
      Edbert P
      wrote on last edited by
      #2

      If you only put last name, the SQL statement will be like SELECT * FROM Users WHERE Last_Name = 'LName' AND FName = '' Most likely it won't return you anything as there won't be a person with FName = '' The easiest way is to use AND FName LIKE'" & strSearchFName & "%'" The recommended way is to make sure your SQL is correct (build a dynamic SQL, e.g. remove FName from condition if FName is not supplied) Hope it helps, Edbert P. Sydney, Australia.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups