Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aceess XP - INSERT INTO - disable popup question

Status
Not open for further replies.

sansei

Programmer
Jan 29, 2003
8
PL
I'm adding a record to a table in VB using command:
DoCmd.RunSQL query
It works fine but Access shows a nasty window that asks the user to confirm adding new records to database.
I don't know how to remove it.
I think it can be done in two ways.
1. In Access 2000 I disabled showing those windows somewhere in options of Access database, but in XP I can't find it (maybe it has been removed or my eyes are getting old), but the database I'm creating will be installed on several PCs and I won't be able to configure all of them, so...
2. There has to be a VB command disabling it, but
On Error Goto 0, nor On Error Resume Next
didn't work. I guess this window isn't handled as an error.

Thanks for any help on this.

btw. does anyone know how to get in VB id of last added record?
 
I believe that the DoCmd is used for Access VBA and not for VB. If you are using VBA then you may get more responses in forum705.

To get the id of the newly added record you will need to learn how to use the @@Identity property. Search tek-tips, msdn or help files for information. Thanks and Good Luck!

zemp
 
I believe it is:

DoCmd.SetWarnings = False [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Thanks people.
SetWarnings worked excellent and @@Identity is also great.
Sorry about writing t the wrong forum, I 'm new to Tek-Tips.
 
sansei, it is not a question of the wrong forum, but rather that there may be a better forum. If you click the Forum List link at the top left of this page you can decide which forum to post in. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top