Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

continuous filtered form check if record present 1

Status
Not open for further replies.

Ali29J

Technical User
May 13, 2004
203
GB
HI All

I have master form "Logistics" and a filtered continuos subform "LogisticsDetail", i am trying to generate on button click to check that the filtered records required are populated.

code is as follows at present:

If IsNull(Forms!Logistics!LogisticsDetail!Shipmentqty.Value) Then
MsgBox "Please enter frieght qty below"
ElseIf IsNull(Forms!Logistics!LogisticsDetail!Boxqty.Value) Then
MsgBox "Please enter box qty below"

but if say 4 records are filtered in the subform and 3 out of the 4 have values in boxqty it will not pick up that one is missing, how do check that all the filtered records have a value present??

if i leave all blank it works fine...

Appreciate anyones help?

THanks

Ali
 
me Subform is called frmDates
my field to check is called dtmDates
in this example
Code:
Private Sub Form_Click()
  Dim rs As DAO.Recordset
  Dim intCount As Integer
  Set rs = Me.frmDates.Form.RecordsetClone
  Do While Not rs.EOF
    If Trim(rs.Fields("dtmDates") & " ") = "" Then
      intCount = intCount + 1
    End If
    rs.MoveNext
  Loop
  If intCount > 0 Then
    MsgBox "You must fill in quantities for " & intCount & " records."
  End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top