R
Robert S. Johnson
Has anyone ever encountered this problem. If so how did
you overcome it?
Even though the application says that initial record is
saved only the control number is saved.
I get an Error 2501: The Open Form Action was canceled
when entering the initial record.
When I look at the table BARequest there is no data in the
first record other than the control number(primary key).
If I continue to try adding records, each subsequent
record establishes a new line with a control number.
However all the rest of the data for the record overwrites
the data in the first record (eg.the second attempt write
a record to the table results in the data associated with
record two goes to record 1. There is a second record line
established with control number 2 but no other data.
I have tried recreating the DB from scratch twice with the
same results each time.
This is the code that is suppose to add records to the
table.
'Adds a new record to the table.
Private Sub cmdAddNew_Click()
On Error GoTo Fix_cmdAddNew_Click_Err
Dim lngNext As Long
lngNext = GetNextID("tblBARequest")
XSQL "INSERT INTO tblBARequest(fldCtlNum) SELECT " &
lngNext
DoCmd.OpenForm "frmBARequest", , , "fldCtlNum = " &
lngNext
Exit_cmdAddNew_Click:
Fix_cmdAddNew_Click_Err:
blnOk = Err.Number = 0
If Not blnOk Then
MsgBox "Error (" & Err.Number &
Err.Description & ")" & vbCrLf, vbCritical
Err.Clear
End If
End Sub
you overcome it?
Even though the application says that initial record is
saved only the control number is saved.
I get an Error 2501: The Open Form Action was canceled
when entering the initial record.
When I look at the table BARequest there is no data in the
first record other than the control number(primary key).
If I continue to try adding records, each subsequent
record establishes a new line with a control number.
However all the rest of the data for the record overwrites
the data in the first record (eg.the second attempt write
a record to the table results in the data associated with
record two goes to record 1. There is a second record line
established with control number 2 but no other data.
I have tried recreating the DB from scratch twice with the
same results each time.
This is the code that is suppose to add records to the
table.
'Adds a new record to the table.
Private Sub cmdAddNew_Click()
On Error GoTo Fix_cmdAddNew_Click_Err
Dim lngNext As Long
lngNext = GetNextID("tblBARequest")
XSQL "INSERT INTO tblBARequest(fldCtlNum) SELECT " &
lngNext
DoCmd.OpenForm "frmBARequest", , , "fldCtlNum = " &
lngNext
Exit_cmdAddNew_Click:
Fix_cmdAddNew_Click_Err:
blnOk = Err.Number = 0
If Not blnOk Then
MsgBox "Error (" & Err.Number &
Err.Description & ")" & vbCrLf, vbCritical
Err.Clear
End If
End Sub