T
Ted
i'm using a2k and i've posted variations of this theme in recent days but
just seem to be getting stuck deeper in things as the plot thickens.....
in broad sweeping terms ( ), when my user is looking at his choices
from amongst the 7 radion buttons in the Frame1 options group, there is an
interest in launching certain macros (which have either append, delete or
update queries attached to them) depending upon a) the radio button selected
and b) the value of the radio button before it was modified by the user. i'm
new to this aspect of a2k, so my impression is that while the user is sitting
on a record, every time he/she selects one of the radio buttons in the Frame1
options group the following happens 1) the value of the options group's
control source i dubbed 'Outcome_' changes and 2, the OldValue property is
updated to reflect the previous value of the radio button's. i don't think
that this is really how vba is set up so if you can help straighthen me out,
i'd appreciate it. i'm attaching some of the AfterUpdate followed by the SQL
version of the append query that the Case 5 macro launches to help put things
into focus.
Private Sub Frame1_AfterUpdate()
Dim Response As Long
Select Case Frame1.Value
Case 1
.....
Case 2
....
Case 3
.....
Case 4
....
Case 5
Me.OffStudyDate.SetFocus
If Me.Frame1.OldValue = 2 Or Me.Frame1.OldValue = 3 Or
Me.Frame1.OldValue = 4 _
Or Me.Frame1.OldValue = 6 Or Me.Frame1.OldValue = 7 Then
DoCmd.RunMacro ("Append Off Study Pxs--Edit Form")
Case 6
Me.LTFUDate.SetFocus
If Me.Frame1.OldValue = 5 Then DoCmd.RunMacro ("Update Off
Study Pxs--Edit Form") Else Results = MsgBox("You have coded this Patient as
either Dead or LTFU. First code this Patient as being Off Study!!!", vbOKOnly
+ vbCritical, "Alert!")
Case 7
Me.DateDth.SetFocus
If Me.Frame1.OldValue = 5 Then DoCmd.RunMacro ("Update Off
Study Pxs--Edit Form") Else Results = MsgBox("You have coded this Patient as
either Dead or LTFU. First code this Patient as being Off Study!!!", vbOKOnly
+ vbCritical, "Alert!")
Case Else
End Select
End Sub
INSERT INTO [Patients on Follow-Up] ( Dummy, [Study#], [Reg#], [IRB Number],
MR_Number, [Pt Initials], [On-Study Date], Site, [Px Status] )
SELECT 1 AS Dummy, [Screening Log].SequenceNum, [Screening Log].[Sponsor ID
Nbr], [Screening Log].[IRB Number], [Screening Log].MR_Number, Left([First
Name],1) & Left([Last Name],1) AS [Pt Initials], [Screening
Log].OffStudyDate, [Screening Log].Campus AS Site, lkpStatus.Status AS [Px
Status]
FROM lkpStatus INNER JOIN [Screening Log] ON lkpStatus.Code = [Screening
Log].Outcome_
WHERE ((([Screening Log].[IRB Number])=[Forms]![Screening Log (Edit
Only)].[IRB Number]) AND (([Screening Log].MR_Number)=[Forms]![Screening Log
(Edit Only)].[MR Number]) AND (([Screening
Log].OffStudyDate)=[Forms]![Screening Log (Edit Only)].[OffStudyDate]) AND
(([Screening Log].Outcome_) In (5)));
just seem to be getting stuck deeper in things as the plot thickens.....
in broad sweeping terms ( ), when my user is looking at his choices
from amongst the 7 radion buttons in the Frame1 options group, there is an
interest in launching certain macros (which have either append, delete or
update queries attached to them) depending upon a) the radio button selected
and b) the value of the radio button before it was modified by the user. i'm
new to this aspect of a2k, so my impression is that while the user is sitting
on a record, every time he/she selects one of the radio buttons in the Frame1
options group the following happens 1) the value of the options group's
control source i dubbed 'Outcome_' changes and 2, the OldValue property is
updated to reflect the previous value of the radio button's. i don't think
that this is really how vba is set up so if you can help straighthen me out,
i'd appreciate it. i'm attaching some of the AfterUpdate followed by the SQL
version of the append query that the Case 5 macro launches to help put things
into focus.
Private Sub Frame1_AfterUpdate()
Dim Response As Long
Select Case Frame1.Value
Case 1
.....
Case 2
....
Case 3
.....
Case 4
....
Case 5
Me.OffStudyDate.SetFocus
If Me.Frame1.OldValue = 2 Or Me.Frame1.OldValue = 3 Or
Me.Frame1.OldValue = 4 _
Or Me.Frame1.OldValue = 6 Or Me.Frame1.OldValue = 7 Then
DoCmd.RunMacro ("Append Off Study Pxs--Edit Form")
Case 6
Me.LTFUDate.SetFocus
If Me.Frame1.OldValue = 5 Then DoCmd.RunMacro ("Update Off
Study Pxs--Edit Form") Else Results = MsgBox("You have coded this Patient as
either Dead or LTFU. First code this Patient as being Off Study!!!", vbOKOnly
+ vbCritical, "Alert!")
Case 7
Me.DateDth.SetFocus
If Me.Frame1.OldValue = 5 Then DoCmd.RunMacro ("Update Off
Study Pxs--Edit Form") Else Results = MsgBox("You have coded this Patient as
either Dead or LTFU. First code this Patient as being Off Study!!!", vbOKOnly
+ vbCritical, "Alert!")
Case Else
End Select
End Sub
INSERT INTO [Patients on Follow-Up] ( Dummy, [Study#], [Reg#], [IRB Number],
MR_Number, [Pt Initials], [On-Study Date], Site, [Px Status] )
SELECT 1 AS Dummy, [Screening Log].SequenceNum, [Screening Log].[Sponsor ID
Nbr], [Screening Log].[IRB Number], [Screening Log].MR_Number, Left([First
Name],1) & Left([Last Name],1) AS [Pt Initials], [Screening
Log].OffStudyDate, [Screening Log].Campus AS Site, lkpStatus.Status AS [Px
Status]
FROM lkpStatus INNER JOIN [Screening Log] ON lkpStatus.Code = [Screening
Log].Outcome_
WHERE ((([Screening Log].[IRB Number])=[Forms]![Screening Log (Edit
Only)].[IRB Number]) AND (([Screening Log].MR_Number)=[Forms]![Screening Log
(Edit Only)].[MR Number]) AND (([Screening
Log].OffStudyDate)=[Forms]![Screening Log (Edit Only)].[OffStudyDate]) AND
(([Screening Log].Outcome_) In (5)));