Autonumber not transferring correctly anymore... 
Author Message
 Autonumber not transferring correctly anymore...

I have two tables connected by code through a form in
Access 2000.  An autonumber variable in table 1 is picked
up by the code associated with the form and is supposed to
be transferred to table 2, where the variable is a long
integer.  This has worked up until the autonumber hit 230,
whereupon all additional entries remain at "230" in table
2 even though the autonumber continues to increment
correctly in table 1 as records are created.  Any ideas
out there regarding why this "limit"?

Thanks.



Sun, 20 Nov 2005 07:10:32 GMT  
 Autonumber not transferring correctly anymore...
You'd need to post the pertinent code for anyone to give an answer, or even
an informed guest.  If the number you mentioned was 255, I'd guess somehow
it was being stored in a byte... not easy in Access, because there's no
one-byte numeric variable type.

Please clarify here in the newsgroup, not by e-mail. Thanks.

  Larry Linson
  Microsoft Access MVP


Quote:
> I have two tables connected by code through a form in
> Access 2000.  An autonumber variable in table 1 is picked
> up by the code associated with the form and is supposed to
> be transferred to table 2, where the variable is a long
> integer.  This has worked up until the autonumber hit 230,
> whereupon all additional entries remain at "230" in table
> 2 even though the autonumber continues to increment
> correctly in table 1 as records are created.  Any ideas
> out there regarding why this "limit"?

> Thanks.



Sun, 20 Nov 2005 07:32:34 GMT  
 Autonumber not transferring correctly anymore...
The pertinent code is given below.  The variable not
behaving correctly is the Audit_ID.  It increments
correctly as an autonumber in the Change Table.tbl, but is
not transferred correctly to the Changed Records.tbl,
where it is a long integer.

<<<<<<<Code Starts>>>>>>>>>>

Private Sub cmdChangeRec_Click()
On Error GoTo Err_cmdChangeRec_Click

Dim dbs As Database, tdf As TableDef, rst As Recordset,
RecNum As Integer

Set dbs = CurrentDb
Set tdf = dbs.TableDefs![Changed Records]

    'Make sure a reason for the modification is given
    If IsNull(Me![txtReason]) Then
        GoTo Err_NoReason2
        End If

    'Registering the change in the Change Table
    Set rst = dbs.OpenRecordset("Change Table")
    With rst
        .AddNew
        !Data_ID = Me![Master Database.Data_ID]
        !Action = "Change"
        !ChangeDate = Date
        !ChangeTime = Time()
        !Author = CurrentUser()
        !Reason = [txtReason]
        .Update
        .MoveLast
        [Forms]![frmDataEdit2]![tmpAudit_ID] = !
Audit_ID.Value
    End With
    Me![txtReason] = ""

    'Save Old Record to Changed Records Table
    Set rst = dbs.OpenRecordset("Changed Records")
    With rst
        .AddNew
        !Audit_ID = Me![tmpAudit_ID]
        !Data_ID = Me![tmpData_ID]
        !STP_ID = Me![tmpSTP]
        !Out_ID = Me![tmpOut_STP]
        !Code = Me![tmpCode]
        !Lot = Me![tmpLot]
        !Stage = Me![tmpStage]
        !Dept_ID = Me![tmpDept]
        !Run_Num = Me![tmpRunNum]
        !Tech_ID = Me![tmpTech]
        !Disp_ID = Me![tmpDisp]
        !Num_Reps = Me![tmpNumReps]
        !Num_Out = Me![tmpNumOut]
        !TestDate = Me![tmpTestDate]
        !EntryDate = Me![tmpEntryDate]
        !EntryTime = Me![tmpEntryTime]
        !EnteredBy = Me![tmpEnteredBy]
        !VerifDate = Me![tmpVerifDate]
        !VerifTime = Me![tmpVerifTime]
        !Verifier = Me![tmpVerifier]
        .Update
    End With
    rst.Close

    RecNum = Me.RecordsetClone.AbsolutePosition + 1

    Requery

    DoCmd.GoToRecord acDataForm, "frmDataEdit2", acGoTo,
RecNum

    Me!cmdPrevRec.Visible = True
    Me!cmdNextRec.Visible = True
    Me!cmdCloseForm.Visible = True
    Me!cmdChangeRec.Visible = False
    Me!cmdUndo.Visible = False

Exit_cmdChangeRec_Click:
    Exit Sub

Err_cmdChangeRec_Click:
    MsgBox Err.Description
    Resume Exit_cmdChangeRec_Click

Err_NoReason2:
    Dim Response
    Response = MsgBox("GET WITH THE PROGRAM!" & Chr(10) &
Chr(10) & "A reason!  A reason!  My kingdom for a
reason!", vbQuestion + vbOKOnly, "Hello?!?")
    If Response = vbOK Then
        GoTo Exit_cmdChangeRec_Click
        End If

End Sub
<<<<<<<<Code Ends>>>>>>>>>

Quote:
>-----Original Message-----
>You'd need to post the pertinent code for anyone to give
an answer, or even
>an informed guess.  If the number you mentioned was 255,
I'd guess somehow
>it was being stored in a byte... not easy in Access,
because there's no
>one-byte numeric variable type.

>Please clarify here in the newsgroup, not by e-mail.
Thanks.

>  Larry Linson
>  Microsoft Access MVP



>> I have two tables connected by code through a form in
>> Access 2000.  An autonumber variable in table 1 is
picked
>> up by the code associated with the form and is supposed
to
>> be transferred to table 2, where the variable is a long
>> integer.  This has worked up until the autonumber hit
230,
>> whereupon all additional entries remain at "230" in
table
>> 2 even though the autonumber continues to increment
>> correctly in table 1 as records are created.  Any ideas
>> out there regarding why this "limit"?

>> Thanks.

>.



Sun, 20 Nov 2005 07:46:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. sorry but again: GUID and AUTONUMBER (not GUID only, not AUTONUMBER only, but both)

2. Creating ADO recordset w/o database .Append not working correctly IIS5 win2000 Prof not .Net

3. How to verify that a file has been transferred correctly

4. A2000 Modules not secured my user-lever security anymore

5. AddinInstance_OnDisconnection in Add-In suddently not called anymore by Outlook

6. Data Link Properties not comming up anymore.

7. Urgent! PUBLIC does not work anymore

8. Why does this not scroll anymore?

9. Microsoft not have QBasic anymore??

10. Rs not avialable anymore

11. VB5CCE can not work anymore :-(

12. NOT counting vowels in a string anymore, Thanks

 

 
Powered by phpBB® Forum Software