Dim Prompt As String
If Me!SubformControlName.Form.RecordsetClone.RecordCount = 0 Then
Cancel = True
Prompt = "At least one location must be specified."
End If
' More checks.
If Cancel = True Then
MsgBox Prompt, vbInformation + vbOkOnly, "New Product"
End If
Dim ChildsMissing As Boolean
If Me!SubformControl1Name.Form.RecordsetClone.RecordCount = 0 Then
ChildsMissing = True
ElseIf Me!SubformControl2Name.Form.RecordsetClone.RecordCount = 0 Then
ChildsMissing = True
ElseIf Me!SubformControl3Name.Form.RecordsetClone.RecordCount = 0 Then
ChildsMissing = True
End If
Me.AllowAdditions = Not ChildsMissing
/gustav
SELECT tblAccountMaster.CommodityID, tblAccountMaster.UtilityID, tblAccountMaster.RateEffectiveDate, tblAccountMaster.RateClassCode, tblAccountMaster.CalcRateExpires, tblAccountMaster.RateExpirationDate, tblAccountMaster.ContractExpirationDate, tblAccountMaster.ReadCycle, tblAccountMaster.EffPlusDropDead, tblAccountMaster.EffReadYear, tblAccountMaster.EffReadMonth, tblAccountMaster.ExpReadYear, tblAccountMaster.ExpReadMonth, tblAccountMaster.RatePrefix, tblAccountMaster.RateAnchorDate, tblAccountMaster.RateAnchorYear, tblAccountMaster.RateAnchorMonth, tblAccountMaster.MarketerAccountNumber, tblAccountMaster.UAN, tblAccountMaster.MeterNumber
FROM tblAccountMaster
WHERE (((tblAccountMaster.MarketerAccountNumber)=[forms]![frmAccountList]![sfrmUniqueAccounts]![MarketerAccountNumber]) AND ((tblAccountMaster.UAN)=[forms]![frmAccountList]![sfrmUniqueAccounts]![UAN]) AND ((tblAccountMaster.MeterNumber)=[forms]![frmAccountList]![sfrmUniqueAccounts]![MeterNumber]))
ORDER BY tblAccountMaster.CommodityID, tblAccountMaster.RateEffectiveDate DESC;
Private Sub Form_Current()
Me.Parent!sfrmAccountRateClasses.Requery
End Sub
SELECT ProductImages.ProductImageID, ProductImages.SkuID, ProductImages.ImageURL
FROM ProductImages
WHERE (ProductImages.SkuID=[forms]![ProdMainEntryForm]![ProdImageSubForm]![SkuID]);
Private Sub Form_Current()
Me.Parent!ProdMainEntryForm.Requery
End Sub
Private Sub Form_Current()
Me.Parent!ProdImageQuerySubform.Requery
End Sub
SELECT ProdLocations.ProdLocID, ProdLocations.LocID, ProdLocations.ProductID, ProdLocations.QtyLoc
FROM ProdLocations
WHERE ([ProdLocations].[SkuID]=[forms]![ProdMainEntryForm]![ProdLocationSubform]![SkuID]);
SELECT ProdLocations.ProdLocID, ProdLocations.LocID, ProdLocations.ProductID, ProdLocations.QtyLoc
FROM ProdLocations
WHERE (ProdLocations.ProductID=[forms]![ProdMainEntryForm]![ProdSubForm]![ProductID]);
Private Sub Form_Current()
Me.Parent!ProdLocSubForm.Requery
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.Parent.SkuID & "" = "" Then
MsgBox "Please enter SKU first.", vbInformation, "Warning"
Cancel = True
Me.Parent!SKU.SetFocus
Exit Sub
End If
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.SkuID & "" = "" Then
MsgBox "Please enter SKU first.", vbInformation, "Warning"
Cancel = True
Exit Sub
End If
End Sub
Private Sub Form_Current()
Me.Parent!ProdLocSubForm.Requery
End Sub
The BeforeInsert should be in the "child" subform. Is that where it is?
Private Sub Form_Current()
Me.Parent!ProdImageSubForm.Requery
Me.Parent!ProdSubForm.Requery
Me.Parent!ProdLocSubForm.Requery
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.SkuID & "" = "" Then
MsgBox "Please enter SKU first.", vbInformation, "Warning"
Cancel = True
Exit Sub
End If
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.Parent!SkuID & "" = "" Then
MsgBox "Please enter SKU first.", vbInformation, "Warning"
Cancel = True
Me.SomeParentControlName.SetFocus 'to move the user back to the main form
Exit Sub
End If
End Sub
Me.SomeParentControlName.SetFocus 'to move the user back to the main form
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.Parent!SkuID & "" = "" Then
MsgBox "Please enter SKU first.", vbInformation, "Warning"
Cancel = True
Me.SomeParentControlName.SetFocus 'to move the user back to the main form
Exit Sub
End
If Me.Parent!SkuID & "" = "" Then
If Me.Parent!SkuID & "" = "" Then
If Me.Parent!Sku & "" = "" Then