473,492 Members | 4,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

adding new record using VBA into existing access database

2 New Member
Hello guys, I'm new to VBA and trying to create a form for inserting new records into an existing access database, the thing is the database is provided by a third party so I don't have control over it's fields specification. there's already 26705 rows I'd like the insertion of new records to continue in the same sequence, that's the code I've used:
Private Sub Command19_Click()

Dim dbConf As DAO.Database
Dim rstNew As DAO.Recordset

Set dbConf = CurrentDb
Set rstNew = dbConf.OpenRecordset("N-MATTE")

rstNew.AddNew
rstNew("DATE").Value = Me.txtDate.Value
rstNew("CLIENT").Value = Me.txtClient.Value
rstNew.Update

End Sub
Sep 18 '16 #1
2 1057
5236
2 New Member
To be more specific, I would like the record id to be auto-generated without having to add it by the form.
Sep 18 '16 #2
informerFR
14 New Member
Hi 5236

If you declare an auto number field on a table, this field increments itself automatically when you add a record on this table. Nothing to do.
Sep 19 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
20845
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
5
10266
by: nicholas | last post by:
I would like to insert a new record in a Ms Access database and retrieve the newly created ID (autonumber). I would like to do it in VB.NET for an ASP.NET page. ( no asp) I found several...
3
11790
by: Phi | last post by:
Hi, I hope somebody could help me with this problem. I would like to make a form to add and delete records from my ms access database. I've found most of the codes from the internet and...
11
1407
by: johnb41 | last post by:
I need to Add, delete, rename, etc columns in my Jet/Access database in my app. I know I can add columns for a dataset, and work with it, but as far as I know there is no way to push the added...
0
884
by: Jon S via DotNetMonster.com | last post by:
Hi all, I've just posted a similar post but I would be happy in just finding the below out. How would I assign a password to an already existing access database using (preferbly) C# or...
7
2209
by: kowndinya | last post by:
Hello, i have developed a small program in VB 6.0 and the backend is MS ACCESS. i want to know who is currently logged ms access database. Some body accessing this database by using my program...
3
2688
by: mysore | last post by:
Hello, I have several textboxes on my VB6.0 form.I am using textboxes one for each field. I have Placed adocontrol on my form to connect to MS access database. The connectivity is fine. I...
2
5774
by: chamali | last post by:
Hi guys, I have created database using ms access & i have ceated a form using vb.net. i want to do this. when i enter the data to the form & after that click Submit button the data must be enter...
6
6198
by: Mark | last post by:
Currently using MS Access 2000 and SQL Server Express. Using the current DAO OpenRecordset code listed below, however I keep getting the error message.... 3254: ODBC --Cannot lock all records ...
14
4607
by: SimeonD | last post by:
Hi I have an access database called Sales.Mdb In vb.net 2005, I'd like to open it. Which I can do. What I can't figure out is how to figure out if Sales.Mdb is open already. If so, I want to open...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.