Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 8th, 2005, 09:24 AM
USCitizen USCitizen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 19 USCitizen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 21 m 37 sec
Reputation Power: 0
writing executable vba statements

i use a2k on a windows 2000 professional desktop.

i built an application a while back which my users have finally got 'round to testing and i want to go over one of the features i put together as part of a response to a 'wish list' from one. the same one wishes it would go one better.....

the ingredients of the scenario go something like this:

there is a main form with a nested sub-form. the main one's called 'Treatment and Toxicity' and the sub-form's called 'Adverse Events (child). the linking child fields are "Patient Number" and "Cycle". the linking master fields are "Patient Number" and "Current Cycle Number".

there is a listbox on the subform which can be "Yes" or "No" which indicates whether the information coded for the patient on the current cycle continues into the next cycle. since these are adverse events in a clinical trial and the data are being captured for each of multiple numbers of cycles in the trial the patient goest through until he de-enrolls or finishes it, an adverse event (e.g. 'headache', etc. etc) have continue beyond the end of the current cycle. so, the data entry person asked if it'd be possible to automatically duplicate a lot of the information in the subsequent cycle which she entered for the patient's current cycle.

the code i designed to do this is below:

Private Sub Duplicate_Click()
Dim Response As Integer
' pending pending
Response = MsgBox("Before proceding to duplicate this record, verify that the top part of this form " & Chr(13) & _
"for this patient's next cycle (i.e., MR and Cycle) were already entered. If not, press 'Cancel', otherwise press 'OK'.", vbOKCancel + vbCritical + vbDefaultButton2, "Critical !")
If Response = 1 Then
With Me.RecordsetClone
.AddNew
![Patient Number] = Me.Patient_Number
' ignore ![Cycle] = Me.Cycle + 1
![Cycle] = Forms![Treatment and Toxicity].[Current Cycle Number] + 1
![AE Description] = Me.AE_Description
![Subtype] = Me.Subtype
![Onset] = Me.Onset
![Grade] = Me.Grade
![Serious] = Me.Serious
![Attribution] = Me.Attribution
![Action] = Me.Action
![Outcome] = Me.Outcome
![DLT] = Me.DLT
![AER Filed] = Me.AER_Filed
![ContinuingEndCycle] = "No"
' the following is intended to add a comment in the Updates field
![Updates] = "On " & Now() & " , " & LAS_GetUserName() & " duplicated this patient's Cycle #" & Forms![Treatment and Toxicity].[Current Cycle Number] & " record."
.Update
Me.Bookmark = .LastModified
End With
Else
End If
End Sub

according to this data entry person, it works like the proverbial charm. however, she's apparently gotten even lazier since i developed this and now wishes that there were some way that pressing a button would set off a series of events which would automatically populate the next cycle for the current patient whenever the listbox were 'Yes' without having to individualize the requests which she currently has to do.

the 'Duplicate' command button on the subform is only 'active' when the value of the listbox (whose name is 'Continuing') is 'Yes' as a safety feature to minimize erroneously launching it. so the machinegun approach to this would involve somehow sending my code through the database for the current patient and current cycle, sifting through all records having a 'Yes' for Me.Continuing and performing the desired action.

i'm waiting for the mis people to send their technician to try to repair the vba help documentation -- which could take quite a while -- so i figured i'd bring this up in this venue.

anyone?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > writing executable vba statements


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway