Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Apr 2007
    Posts
    81

    Unanswered: I don not want show any record unless searching.

    Hi all;

    I have continues form, when I open the form display all records, I don not want show any record unless searching.

    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    consider changing the visibility of the controls using somehtign like
    mycontrolname.visible = true

  3. #3
    Join Date
    Apr 2007
    Posts
    81
    Hi healdem

    I used this code:

    Private Sub ContryNam_Change()
    controlName.Visible = False
    End Sub


    Miss understand your advice.

    thanks

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Put an unbound combobox in the HEADER section of the continous form (call the combobox MySearchField). In that combobox, have a query for your rowsource with your ID field the first field and then the field you want displayed for searching on (make it so the field for searching on is the visible one by setting the column widths: 0;2.)

    Then for the RECORDSOURCE of your continous form, make it a query with criteria where the ID field = Forms!MyContinousFormName!MySearchField. (Note: you could also have multiple different types of queries and simply set the RECORDSOURCE of the continous form to the appropriate query depending on your search boxes. I.e..Forms!MyContinousFormName!RECORDSOURCE = "qryByID" or Forms!MyContinousFormName!RECORDSOURCE = "qryBySomeSearchField"

    Then in the AfterUpdate of the MySearchField, issue a me.requery.
    Last edited by pkstormy; 11-18-07 at 23:12.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    Here is your Sample DB back to you again (attached) with a simple Seach Form installed. It will update the fields within your SubForm based on the search criteria you select (either AND or OR). If you want to see all records again, select none of the search items (clear them) and select the search button.

    Keep in mind...this is just a simple Search Form. Enumerating through the Search Form Criteria controls I think is a cleaner method and checking the Table's Data Type for query development saves a lot of code. But since there are only a few fields in your sample DB, I used If/Then Statements for each field.

    Hope it helps in some way....

    .
    Attached Files Attached Files
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  6. #6
    Join Date
    Apr 2007
    Posts
    81
    HI ALL

    I do not want combobox, I need search directly without addition form.

    Thank you for your efforts to help me.

  7. #7
    Join Date
    Nov 2003
    Posts
    1,487
    What?
    You're not giving much to go by here.
    How do you plan to do your search then?
    Knowing this I think will help us.....help you.

    If you don't want your Continuous Form to show anything....then remove the contents within the Continuous Form's RecordSource Property.

    Fill it when you do your search with a query related to your search criteria.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  8. #8
    Join Date
    Apr 2007
    Posts
    81
    HI CyberLynx

    the sample as the attach you upload (SPECIFIC FORM SIZE - With Search.zip ).
    If you have idea to remove the contents within the continuous forms RecordSource property, please do it for me.

    thanks
    Last edited by SAMI2; 11-20-07 at 21:51.

  9. #9
    Join Date
    Nov 2003
    Posts
    1,487
    OK...I apologize...I get the picture.


    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Or you could try doing it yourself by following CyberLynx' suggestion...

    ...no wait, that's just foolish!
    George
    Home | Blog

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    SamI2 - you should utilize Cyberlynx search method. It's a better way to do your searches. Your users will appreciate it more.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Nov 2003
    Posts
    1,487
    To remove the RecordSource from a Form (or SubForm) do the following:

    - Open the Form in Design View (in your case - the AreaCodFrm Form;
    - Open the Properties Window (if it's not already open);
    - Select the Data Tab located at top of Properties Window;
    - The first property in the list will be the Record Source property;
    - Delete what is in the box beside where it says Record Source.

    There you go....now you know how to do that.

    Again, I have attached your sample DB with the Record Source removed from the AreaCodFrm Form.

    .
    Attached Files Attached Files
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  13. #13
    Join Date
    Apr 2007
    Posts
    81
    HI CyberLynx

    The first sample is good but if you can make it search directly without addition form.

    thanks

  14. #14
    Join Date
    Nov 2003
    Posts
    1,487


    (sigh)

    Ok...you are going to have to get out the old dictionary and explain to me "exactly" how and where you want to initiate the search.

    Where exactly do you want to search from?
    Where exactly do you want to enter the search criteria?
    What exactly do you want to seach for?

    You obviously have something in mind...so either send another realistic Sample Database with what you have in mind installed

    OR

    Upload a picture of what you have in mind (and I don't care if it's done with crayon).

    You need to explain far more than you already have to achieve success here (for me anyway). I'm done guessing at this point.

    I realize there is a slight barrier here but it's nothing that can't be overcome with a little more effort....on your part.

    Please....Please be more specific.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  15. #15
    Join Date
    Apr 2007
    Posts
    81
    HI CyberLynx

    check the picture
    Attached Thumbnails Attached Thumbnails Need No show record.bmp  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •