Solved

adding records problem

Posted on 2002-04-17
11
141 Views
Last Modified: 2010-05-02
i ahve a problem where i cannot seem to add records from my visual basic application to my access database tables.

Can someone please take a look at my project ans see if they can fix it!

Please read the txt file in the rar file

http://www.noel16.freeserve.co.uk/images/Problem.rar

thanks for taking a look at it!

you can contact me on

nod9000@noel16.freeserve.co.uk

 
0
Comment
Question by:nod31
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 4

Expert Comment

by:RichW
ID: 6947899
You're only showing one Update in cmdAddOrder_Click, and even that is not handled if the If statement isn't true.

You're doing a second AddNew when the first one may not be resolved.

RichW

0
 
LVL 4

Expert Comment

by:RichW
ID: 6947912
If it's all the same table do one AddNew, then validate your fields, then perform the Update.

Cheers
RichW
0
 
LVL 4

Expert Comment

by:RichW
ID: 6947953
I've also noticed that your datProducts data object on the frmOrders form has a different path to the db than the other data objects on the form.  It's pointing to the C:\Windows Desktop\Future School\Program Code\FSDBase.mdb, whereas the others are pointing to C:\Future School\Program Code\FSDBase.mdb.



0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
RichW earned 170 total points
ID: 6947993
Also, when you're validating the txtUnitPrice, you're setting the txtTotal field by doing a calculation.  The problem is that the txtQuantity field hasn't yet been populated when this validation fires off, so your result will always be zero.

When the txtTotal field is set to zero you have the txtTotal_Change event firing off (from the txtUnitPrice_Validate event), which invokes an error giving a type mismatch.

You need to clean this up as well.

0
 

Author Comment

by:nod31
ID: 6948021
would it be asking too much if any of you could PLEASE tidy it up a bit, cos i am relatively new to database programming! i would be so grateful!

If i had more points i would definately post them, but thats all i have got, PLEASE PLEASE PLEASE can you help me!

if you do tidy it up, could you send it to me,

nod9000@noel16.freeserve.co.uk


thanks very much!!!

nod31
0
 

Author Comment

by:nod31
ID: 6948024
about the database path, i had copied the database to the other path, its exactally the same, but i forgot to change the paths over to the main one which is the

C:\Windows Desktop\Future School\Program
Code\FSDBase.mdb

0
 
LVL 4

Expert Comment

by:RichW
ID: 6948154
Working on it.
0
 
LVL 4

Expert Comment

by:RichW
ID: 6948209
You should have the files now.
0
 

Author Comment

by:nod31
ID: 6948860
i still cannot seem to get an order added from my visual app to the database, can u help, i havn't modified the code!

Error still keep occurring!

:(
0
 

Author Comment

by:nod31
ID: 6948862
have you got the program to add orders to the database?
0
 
LVL 4

Expert Comment

by:RichW
ID: 6948886
What error are you getting?
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month4 days, 5 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question