Results 1 to 3 of 3
  1. #1
    zarfx4 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15

    Help with Continuous Forms and RecordSource


    Hello all...got a question. Been hashing this out and cant get it to do what I want it to do. I have a Continuous Form that looks at a table and returns results based off a search box on a form. What I want to do is have a MsgBox pop up if no results are returned. Here is what I currently have:

    Code:
    Private Sub search_button_Click()
    
    If Me.filter_ID = "" Then
    MsgBox "Please Enter Merchant (DBA or Legal) or an ID to Search for."
    Exit Sub
    
    Else
    Me.text_search.Visible = True
    
    Me.filter_ID = SuperReplace(Me.filter_ID, " ")
    Me.filter_ID = "*" & Me.filter_ID & "*"
    
    Me.RecordSource = "SELECT * FROM qryMERCHSearch WHERE DBASearch LIKE '" & Me.filter_ID & "'"
    Me.Requery
    
    Me.filter_ID = Replace(Me.filter_ID, "*", "")
    
    Me.ID.Visible = True
    Me.DBA.Visible = True
    Me.Merch.Visible = True
    Me.Email_Date.Visible = True
    Me.Line65.Visible = True
    Me.text_search.Visible = False
    
    End If
    End Sub


    I know i need to do something like a If IsNull or IF ____ = True with the Recordsource and Requery function, but i cannot get it to work correctly...

    any ideas???

    Thanks ahead of time!!!!!

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    What is SuperReplace()? never heard of it

    David

  3. #3
    zarfx4 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15
    its a module that removes specific characters from a string if need be.

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

Similar Threads

  1. cascading combo boxes on Continuous Forms
    By Jerry8989 in forum Forms
    Replies: 0
    Last Post: 10-12-2009, 10:02 AM
  2. Recordsource with Multiple queries
    By darshita in forum Programming
    Replies: 1
    Last Post: 08-10-2009, 03:17 PM
  3. update recordsource of subform
    By AndyKim in forum Forms
    Replies: 1
    Last Post: 06-16-2009, 09:15 AM
  4. Changing A Report Recordsource from a form
    By warrenjburns in forum Reports
    Replies: 0
    Last Post: 04-09-2009, 05:38 AM
  5. Replies: 3
    Last Post: 09-06-2008, 10:19 AM

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