Results 1 to 4 of 4

Thread: delete from DBCombo

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    i have a dbcombo on a form and wish to use it to delete a user. Now everything works fine except for the deleterecord function that i have. Can someone suggest what is wrong with my code :
    Dim mySQL As String

    If MsgBox("Are you sure you want to delete the selected record?", vbQuestion + vbYesNo, App.Title) = vbYes Then

    mySQL = "DELETE * FROM [Password] WHERE PassID = DBCAccounts2.text"

    pDatabase.Execute mySQL

    End If

    now it gets stuck at pdatabse.execute mysql
    thanx in advance for anyone who helps
    Mike

  2. #2
    New Member
    Join Date
    Jun 1999
    Posts
    7

    Post

    I don't know if you made a typo when posting your code, but if you haven't, then your query may not work because you are searching for an entry in your passID field equal to mytextboxname.text.

    Try something like ..

    "Delete * .... WHERE passID = '" & _ +myTextBox.Text & "'"

    So you process the actual string in the textbox and not the name of the textbox in the query.

    Daffy

    PS. If it was a typo, please resubmit so I can reconsider the problem, preferably without the typoes.


  3. #3
    New Member
    Join Date
    Jul 1999
    Location
    London
    Posts
    6

    Post

    Try just "Delete From...." No * should be required.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    Thanks for your help Daffy. What you said has helped solve the puzzle. Thanks

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width