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 April 1st, 2005, 08:36 PM
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
how do duplicate a field's value and increment another's

i have an a2k application and a form having two controls which make up the PK.
a) Patient Number
b) Lesion Number

the form is 'filtered' so when user designates a patient number to work on
from another open form, he's taken to this one and can view only those PNs
selected.

there are multiple records viewable on this form (it's coninuous) each one
having an incrementally larger value of "Lestion Number" (from 1,2,....,12)

i wrote some vba to do that; as shown below in the following attempt, when a form is loading, the value of the Patient Number is gotten from a form called "RECIST Disease Evaluation: Nontarget Lesions"

Private Sub Form_Load()
LAS_EnableSecurity Me
Me.Patient_Number.Value = Forms![RECIST Disease Evaluation: Nontarget
Lesions]![Patient Number]
End Sub

how can i let user simultaneously duplicate a Patient Number and increment a
Lesion Number w/o having to do so manually.

Private Sub Patient_Number_AfterUpdate()
Me.Patient_Number.DefaultValue = "'" & [Patient Number] & "'" ' that's a
single quote within doubles and this line is intended to take care of duplicating the Patient Number
Me.Lesion_Number = IIf(IsNull("[Lesion Number]"), 1, 1 + DMax("[Lesion Number]", "Lesions: Non-Target", "[Patient Number] = " & Me[Patient Number])) ' this should handle the case of incrementing the value of Lesion Number (1,2,3,...,10)
If Me![Lesion Number] > 10 Then
RetValue = MsgBox("Delete any records exceeding the upper limit", vbInformation)
End If
DoCmd.Requery
End Sub

the above intended to duplicate the value of Patient Number and increment Lesion Number.

things aren't working though -- no error messages just not working.

has anyone tried to deal with this question?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > how do duplicate a field's value and increment another's


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 5 hosted by Hostway
Stay green...Green IT