Multi Subforms

Rick

Newbie
Local time
Today, 19:03
Joined
May 22, 2000
Messages
35
Hi, I am working on a "hippa" database, with the following tables/fields:
Table1 : Entity, Dept #, DeptName, Date, DeptHead,PhoneNumber,JobDesc,positionQual,Enteredby,Phonenumber.

Table 2: Code(Code# will be 1,2,4,etc) PHI Description, Function.

Table 3: Patient Population(Memo), Comments(memo),PHI Disclosure(memo)

Table 1 will be the main form, table 2 and 3 will be subforms. For each record on the main form, table 2 can have many codes BUT table 3 will only have 1 Patient population,comments, and PHI Disclosure. How would I set this up to only accept one record for table 3. Currently if i enter patient population in the subform it adds another patient population line. I do not need this. What am I doing wrong? Thanks
 
Nature of the Beast

Access will always put another line there so you can enter another line.

Buuuut ... if the form's Allow Additions property is set to No, it won't be there. So, you will have to run a test from the main form's OnCurrent event that will check to see if there is a record for this subform. If there isn't, set the Allow Additions property to True, otherwise, to False.
 
Thanks PdX

How would i check to see if there is a record for the subform? Sorry, I am a newbie. Rick
 
Use the Dlookup function:

If IsNull(Dlookup("ID","Table3","ID = " & Me.ID) Then
[Forms]![MySubformName].AllowAdditions = True
Else
[Forms]![MySubformName].AllowAdditions = False
EndIf
 

Users who are viewing this thread

Back
Top Bottom