T
Ted
there are two fields on a certain form in my a2k app'n that are of interest
to this thread: "Patient Number" and "Lesion Number". when the form's
opening, the first one is completed 'automatically' via this code immediately
followin:
Private Sub Form_Load()
LAS_EnableSecurity Me
Me.Patient_Number.Value = Forms![RECIST Disease Evaluation: Nontarget
Lesions]![Patient Number]
End Sub
there are repeated instances of the same value of "Patient Number" when the
user is doing their entry (it's also a 'filtered' form so only one patient
number's value is seen at any one time) and what is would like to do is
'automate' the task of entering the "Patient Number" AND also incrementing
the value of "Lesion Number" (1,2,3,....) as records are added.
Private Sub Lesion_Number_Exit(Cancel As Integer)
Me.[Lesion Number] = IIf(IsNull("[Lesion Number]"), 1, 1 + DMax("[Lesion
Number]", "Lesions: Non-Target", "[Patient Number] = " & Me![Patient Number]))
If Me![Lesion Number] > 10 Then
RetValue = MsgBox("Delete any records exceeding the upper limit",
vbInformation)
End If
End Sub
Private Sub Patient_Number_AfterUpdate()
Me.[Patient Number].DefaultValue = "'" & [Patient Number] & "'" ' that's
a single quote within doubles...
End Sub
the first one works just fine. but the 2 and 3rd don't seem to be quite in
synch with each other yet. when the cursor is in the "Patient Number" field
and it's blank i want the duplicated value entered AND i want the "Lesion
Number" to be one more than the previous one (which assumes the records are
sequentially numbered 1,2,3,,,,)
any thoughts?
to this thread: "Patient Number" and "Lesion Number". when the form's
opening, the first one is completed 'automatically' via this code immediately
followin:
Private Sub Form_Load()
LAS_EnableSecurity Me
Me.Patient_Number.Value = Forms![RECIST Disease Evaluation: Nontarget
Lesions]![Patient Number]
End Sub
there are repeated instances of the same value of "Patient Number" when the
user is doing their entry (it's also a 'filtered' form so only one patient
number's value is seen at any one time) and what is would like to do is
'automate' the task of entering the "Patient Number" AND also incrementing
the value of "Lesion Number" (1,2,3,....) as records are added.
Private Sub Lesion_Number_Exit(Cancel As Integer)
Me.[Lesion Number] = IIf(IsNull("[Lesion Number]"), 1, 1 + DMax("[Lesion
Number]", "Lesions: Non-Target", "[Patient Number] = " & Me![Patient Number]))
If Me![Lesion Number] > 10 Then
RetValue = MsgBox("Delete any records exceeding the upper limit",
vbInformation)
End If
End Sub
Private Sub Patient_Number_AfterUpdate()
Me.[Patient Number].DefaultValue = "'" & [Patient Number] & "'" ' that's
a single quote within doubles...
End Sub
the first one works just fine. but the 2 and 3rd don't seem to be quite in
synch with each other yet. when the cursor is in the "Patient Number" field
and it's blank i want the duplicated value entered AND i want the "Lesion
Number" to be one more than the previous one (which assumes the records are
sequentially numbered 1,2,3,,,,)
any thoughts?