currentdb.execute options question

I

Ivan Grozney

Homer Simpson R Me...

I am trying to use
CURRENTDB.EXECUTE strSQL, dbSeeChanges, dbFailOnError
No matter how I put it in the system, I get errors.

How does one use two options with CurrentDB.Execute?

TIA

Vanya
 
K

Klatuu

The Execute method is only used for Action queries, so dbSeeChanges would not
be appropriate. Also, the Execute method bypassed the Access User Interface,
so it would not apply anyway.

If what you are doing is adding a record that should be in the form's
recordset, then you need to requery the form so the new record will be
included.
 
I

Ivan Grozney

Klatuu,

Thanks for the info. What I am doing is modifying a vendor database
(sold it to us then left us with a not fully working product and went who
knows where...).

There is a form where the users enter a bundle of data into the main
form and six or seven sub forms with sub forms. When they hit cancel, it is
all supposed to go away. Now that doesn't work AND the backend is on a SQL
Server. Without the dbSeeChanges I get errors for all my delete queries.

For the near term until I can redo all the forms into unbound columns
and then when they hit finish apply it all I am attempting to delete all the
data they just entered. If I do it without the dbSeeChanges, I get errors.
I can do it with just dbSeeChanges but I like to have the dbFailOnError for
the warm fuzzes I get.

They want me to fix this today so I tried this approach. So while it
may not be the best way to delete the data via a bunch of delete queries
which was my solution to fix it today or else...

Anyway, that is why I am asking.

Vanya
 
K

Klatuu

I have no idea why it is requirng the dbSeeChanges. I have never seen this
happen before.
 
A

Albert D. Kallal

You should be able to use

CURRENTDB.EXECUTE strSQL


try the above.

Also try

debug.print strSQL

Take the the sql shown from the debug window, cut + paste it into a new
query. Does the sql run??? (you ***really*** want to try this idea).
 
J

Jake B

You add the two option constants together:

Currentdb.execute strSQL, dbSeeChanges + dbFailOnError

dbSeeChanges and dbFailOnError are both numeric constants, 512 and 128
respectively. Note that they are both powers of 2. In binary:
dbSeeChanges = 1000000000
dbFailOnError= 10000000
Sum = 1010000000

Note how easy it is to read from the sum what options went in.

The same thing works for MsgBox options.

url:http://www.ureader.com/msg/105414923.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top