Please Help on True False

M

MBoozer

I just can't get it! I have a subform MSDSDocs that is related to another
subform EditSuppliers through a foreign key "IDSupplier". Suppliers can have
many MSDSDocs. When the field LocalScanLink is populated on MSDSDocs, it adds
a True checkmark in the field "Dot" on EditSuppliers subform. Works well with
the following code inserted on the afterupdate on the LocalScanLink field in
MSDSDocs subform:

If Len(Me!SupplierName & "") > 0 Then
Forms![ChemicalInventory].[EditSuppliers].Form!Dot = True
Else
Forms![ChemicalInventory].[EditSuppliers].Form!Dot = False
End If

If while on the MSDSDocs subform and I delete the record, I want the Dot
field on EditSuppleirs to return to False IF there is only one related
record. If there are two or more records, then obviously I want Dot to remain
True. I tried everthing but obviously not the right method. Any ideas on the
code and where I should put it (on what subform) and on what event? Thanks in
advance.
 
M

MBoozer

Got it with RecordsetClone. Sometimes just posting it helps.

If (Me.RecordsetClone.RecordCount = 0) Then
Forms![ChemicalInventory].[EditSuppliers].Form!Dot = False
Else
Forms![ChemicalInventory].[EditSuppliers].Form!Dot = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top