Results 1 to 4 of 4
  1. #1
    QuantifyRisk is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    65

    Continuous Form blank record

    So I have a continuous form with a filter at the top. At the bottom, there's a blank record that I would like to not see. My code is:

    Private Sub cmdFilter_Click()

    Dim strWhere As String
    Dim lngLen As Long

    If Not IsNull(Me.AgencyCode) Then
    strWhere = strWhere & "([AgencyCode] = " & Me.AgencyCode.Value & ") AND "
    End If

    If Not IsNull(Me.AgencyName) Then
    strWhere = strWhere & "([AgencyName] Like ""*" & Me.AgencyName & "*"") AND "
    End If

    If Not IsNull(Me.LicensingRep) Then
    strWhere = strWhere & "([LicensingRep] = """ & Me.LicensingRep & """) AND "
    End If

    lngLen = Len(strWhere) - 5
    If lngLen <= 0 Then
    MsgBox "No criteria", vbInformation, "Nothing to do."
    Else
    strWhere = Left$(strWhere, lngLen)

    Me.Filter = strWhere
    Me.FilterOn = True
    End If
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Sounds like a new record. Try setting Allow Additions to No.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    QuantifyRisk is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    65
    Awesome. Thanks pbaldy.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. More than One Record on filtered Continuous Form
    By Williams485 in forum Forms
    Replies: 3
    Last Post: 03-13-2013, 04:56 AM
  2. Replies: 3
    Last Post: 10-12-2012, 01:38 PM
  3. Delete continuous form record
    By tylerg11 in forum Forms
    Replies: 3
    Last Post: 03-09-2012, 03:00 PM
  4. Hiding a new record in a continuous form
    By system243trd in forum Forms
    Replies: 3
    Last Post: 12-03-2011, 01:04 AM
  5. Get position of record in continuous form
    By Whizbang in forum Forms
    Replies: 3
    Last Post: 11-02-2011, 01:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums