473,414 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

help me Add new records

38
Alem
Hellow all!!

I tried to Add New recored , my code is:-

Private Sub mnuconp_Click()
Dim N
On Error GoTo cmdokError
If currentcommand = "Add" Then
rs.AddNew
For i = 0 To 15
rs.Fields(i) = txtb(i)
Next i
N = MsgBox("Added", vbOKOnly, "Add")
rs.Update

End If
cmdokEnd:
cmdokError:
rs.CancelUpdate

please help me as usual.
Thank you in advance.
Feb 5 '08 #1
2 935
debasisdas
8,127 Expert 4TB
Try to use this sample format

Expand|Select|Wrap|Line Numbers
  1. dim con as new adodb.connection
  2. con.begintrans
  3. con.execute "your sql statment"
  4. con.committrans
  5.  
Feb 5 '08 #2
lotus18
866 512MB

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. Private Sub mnuconp_Click()
  4. Dim N
  5.  On Error GoTo cmdokError
  6. If currentcommand = "Add" Then
  7. rs.AddNew
  8. For i = 0 To 15
  9. rs.Fields(i) = txtb(i)
  10. Next i
  11. N = MsgBox("Added", vbOKOnly, "Add")
  12. rs.Update
  13.  
  14. End If
  15. cmdokEnd: <------------What's this?
  16. cmdokError:
  17. rs.CancelUpdate
  18.  
So what's the problem?

Rey Sean
Feb 5 '08 #3

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

Similar topics

3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
1
by: PMBragg | last post by:
ORINGINAL Post >Thank you in advance. I'm trying to pull all inventory items from December >of the previous year back to 4 years for my accountant. I know this can be >done, but I'm drawing a...
3
by: Adam | last post by:
Hello, I have a 2 column file that looks like this: VALUE1 | VALUE2 12 | 7 10 | 7 9 | 8 10 | 8 11 | 8 6 | 9 8 | 9
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
6
by: Paul T. Rong | last post by:
Dear all, Here is my problem: There is a table "products" in my access database, since some of the products are out of date and stopped manufacture, I would like to delete those PRODUCTS from...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
2
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a...
4
by: RH | last post by:
Hi, I am building a windows application that has a feature that retrieves a set of records when a button is clicked. When the records are being retrieved I experience a complete system...
0
by: Tomazas | last post by:
Hi All, I have very complex database and I am trying to build an Shaped SQL string with no success. Could anyone help me to answer how this would look like. TABLE LIST: Asset, Structure,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.