G
Guest
hi,
wish i could've responded sooner -- the suspense's been killing me.....but i
just got a chance to work on this. w/o further ado, the code's now looking
like the following which reflects the added snippet
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
Dim sql As String
Dim pn As Long
Dim ln As Integer
pn = [Forms]![RECIST Disease Evaluation: Nontarget Lesions]![Patient
Number]
ln = Nz(DMax("[Lesion Number]", "[Lesions: Non-Target]", "[Patient
Number] = " _
& [Forms]![RECIST Disease Evaluation: Nontarget Lesions]![Patient
Number]), 0) + 1
sql = "INSERT INTO [Lesions: Non-Target] ( [Patient Number], [Lesion
Number] )" & _
"SELECT " & CStr(pn) & " AS PN, " & CStr(ln) & " AS LN;"
Dim db As Database
Set db = CurrentDb
db.Execute sql
Set db = Nothing
Dim rs As Recordset
Set rs = Me.Recordset.Clone
rs.FindFirst "[Patient Number]=" & CStr(pn) & " and [Lesion Number]=" &
CStr(ln)
Me.Bookmark = rs.Bookmark
' DoCmd.GoToRecord , , acNewRec
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.description
Resume Exit_Add_Record_Click
End Sub
AND the behavior's no different. clicking still results in an added record
to the ControlSource table but no apparent difference to the observer using
the form that has the Add Record button :-(
-ted
wish i could've responded sooner -- the suspense's been killing me.....but i
just got a chance to work on this. w/o further ado, the code's now looking
like the following which reflects the added snippet
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
Dim sql As String
Dim pn As Long
Dim ln As Integer
pn = [Forms]![RECIST Disease Evaluation: Nontarget Lesions]![Patient
Number]
ln = Nz(DMax("[Lesion Number]", "[Lesions: Non-Target]", "[Patient
Number] = " _
& [Forms]![RECIST Disease Evaluation: Nontarget Lesions]![Patient
Number]), 0) + 1
sql = "INSERT INTO [Lesions: Non-Target] ( [Patient Number], [Lesion
Number] )" & _
"SELECT " & CStr(pn) & " AS PN, " & CStr(ln) & " AS LN;"
Dim db As Database
Set db = CurrentDb
db.Execute sql
Set db = Nothing
Dim rs As Recordset
Set rs = Me.Recordset.Clone
rs.FindFirst "[Patient Number]=" & CStr(pn) & " and [Lesion Number]=" &
CStr(ln)
Me.Bookmark = rs.Bookmark
' DoCmd.GoToRecord , , acNewRec
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.description
Resume Exit_Add_Record_Click
End Sub
AND the behavior's no different. clicking still results in an added record
to the ControlSource table but no apparent difference to the observer using
the form that has the Add Record button :-(
-ted