Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-26-2002, 05:30 AM   #1
Autoeng
Why me?
 
Autoeng's Avatar
 
Join Date: Aug 2002
Location: Kentucky, USA
Posts: 1,302
Thanks: 0
Thanked 2 Times in 2 Posts
Autoeng
Opinions needed concerning paid programming error

I paid a developer (private individual) to add some functions to my database that I didn't feel qualified to make myself and that after posting couldn't find answers to on the various forums that I belong to. The changes were made and I tested the database in the full user environment for one week before approving payment to th developer. Payment (therefore the db) was approved 9/25 and payment was made 10/14. On 10/23 we discovered a problem that resulted in an runtime error. The developer had used DMax in an Before Insert procedure to renumber a sequencing number of a table that allow me to control the sequence of records. After contacting the developer concerning the problem he responded that the best solution would be to move the resequencing procedure from Before Insert to a local variable and fired as an After Update. For this the developer requested an additional payment. My stand is that the developer did not perform adequate testing before delivery and that he should be solely responsible for fixing it. No changes have been made to the db since delivery that could be contributing to the problem. The problem occurs because the D function cannot keep up with the users data entry speed. One month is not a period of time where I feel that the developer is no longer obligated for the problem. Am I wrong?

I am interested in your opinions on this and how to avoid this situation in the future (ie how long of a "warranty" period should I specify for work performed?).

If you're curious here is the code.

Private Sub Form_BeforeInsert(Cancel As Integer)

Dim varLookup As Variant
varLookup = DMax("Seq", "ECNPartstbl", "[ECNBCNVIP ID]= " &
Forms![ECNBCNVIPfrm].[ECNBCNVIP ID])
If Not IsNull(varLookup) Then
Me.Seq = CByte(varLookup) + 1
Else
Me.Seq = 1
End If

Me.Seq = CByte(varLookup) + 1 generates the error


Thanks for your input,
Autoeng

Autoeng is offline   Reply With Quote
Old 10-26-2002, 06:10 AM   #2
Tim K.
Registered User
 
Join Date: Aug 2002
Location: Thailand
Posts: 242
Thanks: 0
Thanked 1 Time in 1 Post
Tim K.
You should have signed a MOU or contract and indicated an after-care service. I myself as a freelance developer will normally take care all bugs in my code if there are any and if proved as my fault within one year after the hand-over. The bug you showed here is the programmer's fault obviously.

CByte() can handle number up to 255 only, you'll get Overflow error if the number is higher than this.

Code:
...
Dim varLookup As Variant, lngMax As Long 
varLookup = DMax("Seq", "ECNPartstbl", "[ECNBCNVIP ID]= " & 
Forms![ECNBCNVIPfrm].[ECNBCNVIP ID]) 
If Not IsNull(varLookup) Then 
   lngMax = Val(varLookup) + 1 
Else 
   lngMax = 1 
End If 
Me.Seq = lngMax 
...
Tim K. is offline   Reply With Quote
Old 10-27-2002, 08:09 PM   #3
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,253
Thanks: 15
Thanked 1,592 Times in 1,512 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
I don't believe that the developer is entitled to any more money. As long as you haven't changed the db, he should stand behind his work and fix the problem.

The BeforeInsert event is too soon to generate the sequence number unless the code also saves the new record or updates the sequence number stack. This event is fired as soon as someone starts typing on the form. This is when Access would generate an autonumber but the diffenence is that Access would also immediately save the assigned number so that the next person to attempt to add a record would get the next sequential number and there would be no conflicts.

For user-generated sequence numbers, you should assign them as close to the save-record point as possible to minimize the potential conflicts in a multi-user environment. Move the code to the form's BeforeUpdate event. This is the last event fired before the record is saved. Unless you have an extremely busy data entry department, this should resolve the conflict issue.

Pat Hartman is offline   Reply With Quote
Old 10-29-2002, 04:44 AM   #4
Autoeng
Why me?
 
Autoeng's Avatar
 
Join Date: Aug 2002
Location: Kentucky, USA
Posts: 1,302
Thanks: 0
Thanked 2 Times in 2 Posts
Autoeng
Gentlemen:

Thank you for your opinions. After much discussion with the devolper he has agreed to correct the db free of charge but now I am in another pickle. I have recommendations from each of you as to the best way to correct the problem. The developer has responded...

"The problem probably isn't "when" the routine fires but just the fact that it can take a little time to do a DMax function. I think the best option would be to avoid doing the DMax with each new part. You could do a Dmax on the form's on_current event to get the max seq# for the ECN when it is first
loaded. That could be placed into a local variable and incremented each time a part is added to the ECN. That should solve the speed issue."

Should I let him proceed with the proposed change or how should I address the issues which you have brought up? I know if I was a developer I would probably have issues with someone critiquing my solution.

Any suggestions as to how to present this to the developer?

Autoeng
Autoeng is offline   Reply With Quote
Old 10-29-2002, 05:34 AM   #5
Tim K.
Registered User
 
Join Date: Aug 2002
Location: Thailand
Posts: 242
Thanks: 0
Thanked 1 Time in 1 Post
Tim K.
I prefer to run the code on OnDoubleClick of the SEG text box like this.

Code:
Private Sub Seg_DblClick()
Dim varLookup As Variant, lngMax As Long 
varLookup = DMax("Seq", "ECNPartstbl", "[ECNBCNVIP ID]= " & 
Forms![ECNBCNVIPfrm].[ECNBCNVIP ID]) 
If Not IsNull(varLookup) Then 
   lngMax = Val(varLookup) + 1 
Else 
   lngMax = 1 
End If 
Me.Seq = lngMax 
End Sub
My suggestion is like a shot in the dark since I don't know other objects and the db structure, so you'd better suggest him several options given here.
Tim K. is offline   Reply With Quote
Old 10-29-2002, 07:17 PM   #6
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,253
Thanks: 15
Thanked 1,592 Times in 1,512 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
If Me.Seq = CByte(varLookup) + 1 generates the error generates the error, I would change the field size before changing anything else.

Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 11:51 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World