Opinions needed concerning paid programming error (1 Viewer)

Autoeng

Why me?
Local time
Today, 14:29
Joined
Aug 13, 2002
Messages
1,302
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
 

Tim K.

Registered User.
Local time
Today, 19:29
Joined
Aug 1, 2002
Messages
242
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 
...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:29
Joined
Feb 19, 2002
Messages
43,257
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.
 

Autoeng

Why me?
Local time
Today, 14:29
Joined
Aug 13, 2002
Messages
1,302
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
 

Tim K.

Registered User.
Local time
Today, 19:29
Joined
Aug 1, 2002
Messages
242
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.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:29
Joined
Feb 19, 2002
Messages
43,257
If Me.Seq = CByte(varLookup) + 1 generates the error generates the error, I would change the field size before changing anything else.
 

Users who are viewing this thread

Top Bottom