Share via

Customs system message on Update Query

Anonymous
2016-04-14T19:43:18+00:00

Hello,

I have created an update query that clears all check boxes on one field. I would appreciate guidance if anyone has done this before on how to customize the msg that comes up after click to run UPDATE query. In addition, in instances when all the checkboxes are cleared for that particular field, there is a system msg that comes up "Microsoft Access can't update all the records in the update query". Any suggestions on how I can handle this error.

Thanks.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

10 answers

Sort by: Most helpful
  1. Anonymous
    2016-04-14T22:13:28+00:00

    Understood.

    As requested Here is the SQL text:

    UPDATE [TBL_CreditSales] SET [TBL_CreditSales].PrintRep = "";

    I have a button on my CreditSales FRM to which I have assigned an OpenQuery macro to execute the update query. I should note that once the query runs it updates the records on the form without any issue at all. What I need help on is how to customize the messages and handle situations where there are 0 record to update.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-04-14T21:39:34+00:00

    Correct the error in the query, or in the context (when and how the query is run).

    For help doing so please open the query in SQL view and post the SQL text here, and tell us (in detail, not just "from a form") how you are running the query. 

    Do note that an UPDATE query will not be able to update a record if it is currently open for update on a Form; I suspect that's the source of the error here. You may need to move off the current record before running the query.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-04-14T21:11:48+00:00

    Iam executing the query via a form

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,830 Reputation points Volunteer Moderator
    2016-04-14T20:20:45+00:00

    You can suppress that message, but not change it. We need to see your code that is running the Update query.

    Was this answer helpful?

    0 comments No comments
  5. DBG 11,711 Reputation points Volunteer Moderator
    2016-04-14T19:47:09+00:00

    How are you executing the query? If you're using a form, there may be a way to trap the error.

    Was this answer helpful?

    0 comments No comments