Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.net error in code while deleting ms access row.

Posted on 2016-10-20
3
Medium Priority
?
44 Views
Last Modified: 2016-11-08
Dim cb As New OleDb.OleDbCommandBuilder(da)
        ds.Tables("Seniors").Rows(inc).Delete()
        da.Update(ds, "Seniors") ' I GET ERROR HERE!
        RefreshNew()
        inc = -1

Error:
 Syntax error (missing operator) in query expression '((id = ?) AND ((? = 1 AND Name IS NULL) OR (Name = ?)) AND ((? = 1 AND Amount(EGP) IS NULL) OR (Amount(EGP) = ?)) AND ((? = 1 AND Quantity IS NULL) OR (Quantity = ?)) AND ((? = 1 AND IG/N IS NULL) OR (IG/N = ?)) AND ((? = 1 AND Notes IS NULL) OR (Notes = '.
0
Comment
Question by:Steve Roseik
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 1000 total points (awarded by participants)
ID: 41852912
You should be able to see, that the last expression is incomplete and without meaning:

    OR (Notes = '.

So correct that.

/gustav
0
 
LVL 28

Assisted Solution

by:Ark
Ark earned 1000 total points (awarded by participants)
ID: 41853039
CommandBuilder require primary key. Check if "Seniors" table has a PK.
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 41878463
No response from questioneer.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question