Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Canary Islands

    Arrow Unanswered: Problems with Combo Boxes =(

    Hello, I'm new here.
    I'm developing an Access project (for a library) for my A level certificate, but here in school we haven't any Access book or whatever...Extremely sad.

    ANyway, my *actual* problem is the follow:

    In the menu' of the books I'd like to insert a researching method (by author, title, isbn number or type) with combo boxes, for example:

    Search a book by --> [combo box with options].

    Now, how do I say to the combo box that, if the user clicks on "author", for example, it should open the parameter query for searching for that author?

    Or also, how do I create a combo box with the names of the authors, and, if the user clicks on an author's name, all the books of that author will appear?

    Please help me, I don't have much time left and I have no resources...

    Well, thanks to everyone!


  2. #2
    Join Date
    Dec 2002
    Canary Islands
    Here's my database. It sucks, yes ^_^ the password is: AdminOfLibrary

    if you could do something, well, could God save your souls

    Attached Files Attached Files

  3. #3
    Join Date
    Oct 2002
    Leicester - UK
    affraid i don't know of an easy way of doing it. the simplest method would be to:

    1. change the combo box so that it holds the values
    "SearchByAuthor", "author"
    "SearchByTitle", "title"
    "SearchByISBN", "isbn number"
    "SearchByType", "type"

    2. add the code
    Docmd.openform(combobox.value, acNormal)

    any more and i'd feel like i was doing your coursework for you
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  4. #4
    Join Date
    Aug 2002
    Northampton, England
    Have a look at the Microsoft Knowledge base. There are a couple of articles that may help.

    How to Use the Query by Form (QBF) Technique;en-us;Q95931

    Query by Form (QBF) Using Dynamic QueryDef (95/97);en-us;Q136062


  5. #5
    Join Date
    Dec 2002
    Préverenges, Switzerland
    Here's another thought that doesn't use combos: the first discussion below considers a single search (e.g. by author) -

    Text-box-A on YourForm - default is empty
    Hidden text-box-B on YourForm - default is unimportant
    [Search] button on YourForm which does:
    if isNull(box-A.value) or (Len(box-A.value) < 1) then
    box-B.value = "*"
    box-B.value = "*" & box-A.value & "*"

    Then you need a query to feed YourResults. Use criteria for author:
    Like Forms!

    This hits with any case-independent substring match, i.e. "Ak" hits Shakespeare

    You can extend this to additional fields two ways:

    1. duplicate the box pairs for each searchable field and add the code to generate the values for each of the hidden boxes and add the fields/criteria (AND-wise) to your query. "aM" and "Ak" hits Hamlet by Shakespeare.

    2. use the same search string (OR-wise) in your query for all the fields you want to search so that "Ak" hits Hamlet by Shakespeare _and_ Cake Recipes by Fred Smith.


Posting Permissions

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