Linking Specific Record Between Subforms

G

Guest

I have 2 subforms (MSDSDocs and EditSuppliers) on my main form
(ChemicalInventory). MSDSDocs and EditSuppliers are Visible.NotVisible when
user clicks on a control. There are many MSDSDocs for any given supplier. I
want a greendot image to appear for each SupplierName record from
EditSuppliers subform if a corresponding MSDSDocs record exists in the
LoalScanLink field of the MSDSDocs subform. Otherwise show a reddot image.

The SupplierName field on the EditSuppliers subform is set to show a
continuous form so the user sees a list of all suppliers. I have a control
button beside each supplier that when clicked, makes the subform MSDSDocs
visible. If there are no MSDSDocs records, the user shoudl be able to know
this before clicking the control. That is why I want a reddot/greendot
arrangement. I have it working except that the dots turn red or green for all
the Suppliers. If only one supplier in the list has an MSDSDocs record, all
the dots for the suppler list turn green. Only the one single record shoudl
turn green and the others shoudl stay red. I believ this is a simply
LinkChildMaster issue and I need to create an unbound text box somewhere and
set its control to either IDSupplier or IDMSDSDocs and then link either two
forms together but mind is turning to mush. Any help woule be appreciated.
Sorry for the long post. Code below:

If IsNull(Me.LocalScanLink) Then
Forms!ChemicalInventory.SetFocus
Forms!ChemicalInventory.EditSuppliers.SetFocus
Forms![ChemicalInventory]![EditSuppliers].Form.imgRedDot.Visible = True
Forms![ChemicalInventory]![EditSuppliers].Form.imgGreenDot.Visible = False
ElseIf Not IsNull(Me.LocalScanLink) Then
Forms![ChemicalInventory]![EditSuppliers].Form.imgGreenDot.Visible = True
Forms![ChemicalInventory]![EditSuppliers].Form.imgRedDot.Visible = False
End If






If IsNull(Me.LocalScanLink) Then
Forms!ChemicalInventory.SetFocus
Forms!ChemicalInventory.EditSuppliers.SetFocus
Forms![ChemicalInventory]![EditSuppliers].Form.imgRedDot.Visible = True
Forms![ChemicalInventory]![EditSuppliers].Form.imgGreenDot.Visible = False
ElseIf Not IsNull(Me.LocalScanLink) Then
Forms![ChemicalInventory]![EditSuppliers].Form.imgGreenDot.Visible = True
Forms![ChemicalInventory]![EditSuppliers].Form.imgRedDot.Visible = False
End If
 
G

Guest

Table relationships are:

tblChemicals
--------------
IDPartNo
ChenName

tblSuppliers
---------
IDPartNo
IDSupplier
SupplierName

tblMSDSDocs
------------
IDPartNo
IDSupplier
IDMSDS
LocalScanLink
Etc....
 

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