473,385 Members | 1,645 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,385 software developers and data experts.

problem somewhere i cannot find

im new to vb, still learning how to handel stuff....
i have this run-time error '91' that says that refers to .Addnew

this is my coding

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Private Sub Form2_Load()
  3.     With Adodc1
  4.       .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
  5.             App.Path & "\database3.mdb;Persist Security Info=False"
  6.         .RecordSource = "select * from Entry order by Name, Contact"
  7.     End With
  8.     Set MSHFlexGrid1.DataSource = Adodc1
  9.     MSHFlexGrid1.FormatString = "Name    |    Contact Number |    Table"
  10.  
  11.  
  12.  
  13. End Sub
  14.  
  15. Private Sub cmdAddEntry_Click()
  16.     With Adodc1.Recordset
  17.         .AddNew
  18.         !Name = Text1
  19.         !Contact = Text2
  20.         !Table = Text3
  21.         .Update
  22.         .Requery
  23.     End With
  24.     Adodc1.Refresh
  25.     Set MSHFlexGrid1.DataSource = Adodc1
  26.     MSHFlexGrid1.FormatString = "Name    |    Contact Number |    Table"
  27.     Text1 = ""
  28.     Text2 = ""
  29.     Text3 = ""
  30.     Text1.SetFocus
  31.  
  32. End Sub
  33.  
  34. Private Sub cmdRemoveEntry_Click()
  35.     With Adodc1.Recordset
  36.         .Move (MSHFlexGrid1.Row - 1)
  37.         .Delete
  38.         .Requery
  39.     End With
  40.     Adodc1.Refresh
  41.     Set MSHFlexGrid1.DataSource = Adodc1
  42.     Text1.SetFocus
  43. End Sub
  44.  
  45. Private Sub Text1_Change()
  46.     If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" Then
  47.         cmdAddEntry.Enabled = True
  48.     Else
  49.         cmdAddEntry.Enabled = False
  50.     End If
  51.  
  52. End Sub
  53.  
  54. Private Sub Text2_Change()
  55.     Call Text1_Change
  56. End Sub
  57.  
  58. Private Sub Text3_Change()
  59.     Call Text1_Change
  60. End Sub
  61.  
  62. Private Sub Text3_KeyPress(KeyAscii As Integer)
  63.     Dim TrackKey As String
  64.     TrackKey = Chr(KeyAscii)
  65.     If (Not IsNumeric(TrackKey) And Not (KeyAscii = vbKeyBack)) Then
  66.         KeyAscii = 0
  67.     End If
  68.  
  69. End Sub
Apr 25 '07 #1
3 1040
hehe sorry. new here :P anyone can help?
Apr 25 '07 #2
Killer42
8,435 Expert 8TB
hehe sorry. new here :P anyone can help?
I've been puzzling over this one a bit, but have never used the ADO data control. I have seen error 91 before, but it was generally because I had defined an object variable of some sort and not Set it to anything. If this is a control on the form, I imagine that shouldn't be necessary.
Apr 25 '07 #3
ic... arite... thnx allot :P!!!
Apr 30 '07 #4

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

Similar topics

18
by: George Sakkis | last post by:
I'm looking for a design to a problem I came across, which goes like this (no, it's not homework): 1. There is a (single inheritance) hierarchy of domain classes, say A<-B<-..<-Z (arrows point...
7
by: addled | last post by:
Hi there, after reading posts here for a few months, I've built the courage to see if someone can see where I"m going wrong in the webpage I've been working on. In particular the horizontal nav...
4
by: jiing.deng | last post by:
I want to transfer a value "re1" to ldapDeleteUserExec.php The "alert(document.ha)" appears a dialog and shows "undefined." The "alert(document)" shows "object" But there seems some problem:...
4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
9
by: sandlovic | last post by:
Hi, I am trying to access a website which seems to be writen in PHP http://tools.neb.com/NEBcutter2/index.php However, neither IE nor firefox would load the page. I am running WinXP SP2 and IE...
9
by: Symon | last post by:
I've got a web service project that was built under VS 2003 which has a SoapExtension in the project. The SoapExtension is registered in the <soapExtensionTypes> element of the web.config and has...
18
by: Chubbly Geezer | last post by:
Now I'm coming from a VB6 background so I may be overlooking something here. I have functionality that is contained with 2 VB 2005 dll's. WARC_Subs_Reporting.dll which handles report functions...
2
by: Explore_Imagination | last post by:
The task is to solve a constrained optimization problem in C. Computational Time is of high priority. One approach can be to use ready functions in a "free ware" Optimization Library (if...
6
by: Vesa-Matti Sarenius | last post by:
I am trying to set up Linux printing via Windows XP and using this HOWTO: http://justin.yackoski.name/winp/ I have one problem. When I send a file via CUPS to the windows spool directory...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.