Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

How to get *just* update query confirmation

Discussion in 'Information Technology' started by Sean S - Perth, WA, Jul 28, 2006.

  1. Sean S - Perth, WA

    Sean S - Perth, WA
    Expand Collapse
    Guest

    Hi all,

    When I run an update query Access warns me I'm about to run an update query
    then stops again and tells me how rows are about to be updated. 2 warnings.

    How do I get it to just give the one (sensible) warning?

    Unticking the Edit/Find Confirm option removes the warning altogether. FFS.

    Is that my only choice, 2 warnings or no warning?


    --
    Sean.
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    How are you running this query?

    If you use the Execute method, you can:
    a) avoid the unnecessary warning;
    b) get any failure message;
    c) get the number of records affected;
    d) use a transaction and rollback if desired.

    The disadvantages of the Execute method are:
    a) You need to resolve any parameters before the execute.
    b) There is more work in getting the transaction right.

    Basic code to exeute Query1 and report the results:
    With dbEngine(0)(0)
    .Execute "Query1"
    MsgBox .RecordAffected " record(s) inserted."
    End With

    The parameters issue applies only if your query contains something like:
    [Enter a date]
    or
    [Forms].[Form1].[Text0]
    My preference is to build the SQL string to concatenate these values in, and
    execute the string rather than a saved query.

    For an example of how to get the transaction right, see
    Archive: Move records to another table
    at:
    http://allenbrowne.com/ser-37.html
    The example shows how to execute 2 transactions and roll them both back, but
    the process is the same for a single transaction.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Sean S - Perth, WA" <SeanSPerthWA@discussions.microsoft.com> wrote in
    message
    news:FECE94D6-2160-43BE-9DA2-6263B3A821B2@microsoft.com...
    > Hi all,
    >
    > When I run an update query Access warns me I'm about to run an update
    > query
    > then stops again and tells me how rows are about to be updated. 2
    > warnings.
    >
    > How do I get it to just give the one (sensible) warning?
    >
    > Unticking the Edit/Find Confirm option removes the warning altogether.
    > FFS.
    >
    > Is that my only choice, 2 warnings or no warning?
     
  4. Sean S - Perth, WA

    Sean S - Perth, WA
    Expand Collapse
    Guest

    "Allen Browne" wrote:

    > How are you running this query?


    Yes, I should have specified.

    From the Queries listing.

    My post was more about how poorly warning the user is handled by Access.
    IIRR previous versions of Access handled this occurence with a single warning.

    Basically all I want to know is how many records are updated with having to
    go through a warning clicking 'frenzy'.

    The first warning says 'to prevent this message from appearing...' when what
    it should actually say is 'to prevent this message *and* the next message
    from appearing...'.


    --
    Sean.
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page