Hi All,
I am using the code below to highlight to the DB user that a piece of equipment is available from two suppliers or vendors.
I am using a form named Equipment which has a checkbox named MultipleSource and Label51 embedded. The form (Equipment) is used both independently and also as as subform.
When using the Equipment form independently on its own, the code works fine, but when the Equipment form is used as a subform, when DCount is >1 the code runs fine, apart from the MsgBox pops up consequitively 4,5 or sometimes even 6 times?
I have disabled other code to see if there is any improvement, but no change.
Any ideas?
Thanks in advance.
Mark
(Access2003).
If DCount("*", "tbl VendorEquipmentJUNCTION", "[EquipmentID] = " & Me!EquipmentID) > 1 Then
Me.MultipleSource = -1
Me.Label51.FontBold = True
Me.Label51.ForeColor = vbRed
Me.Label51.BackStyle = 1
Me.Label51.BackColor = vbYellow
Command68.Visible = True
MsgBox "Multi Source item"
Else
Me.MultipleSource = 0
Me.Label51.FontBold = False
Me.Label51.ForeColor = vbBlack
Me.Label51.BackStyle = 0
Command68.Visible = False
End If
I am using the code below to highlight to the DB user that a piece of equipment is available from two suppliers or vendors.
I am using a form named Equipment which has a checkbox named MultipleSource and Label51 embedded. The form (Equipment) is used both independently and also as as subform.
When using the Equipment form independently on its own, the code works fine, but when the Equipment form is used as a subform, when DCount is >1 the code runs fine, apart from the MsgBox pops up consequitively 4,5 or sometimes even 6 times?
I have disabled other code to see if there is any improvement, but no change.
Any ideas?
Thanks in advance.
Mark
(Access2003).
If DCount("*", "tbl VendorEquipmentJUNCTION", "[EquipmentID] = " & Me!EquipmentID) > 1 Then
Me.MultipleSource = -1
Me.Label51.FontBold = True
Me.Label51.ForeColor = vbRed
Me.Label51.BackStyle = 1
Me.Label51.BackColor = vbYellow
Command68.Visible = True
MsgBox "Multi Source item"
Else
Me.MultipleSource = 0
Me.Label51.FontBold = False
Me.Label51.ForeColor = vbBlack
Me.Label51.BackStyle = 0
Command68.Visible = False
End If