Search results

  1. J

    Filter query that may contain null values

    By the way, can I make the listbox only contain unique values? I've done this before by adding Totals and Group By in the query but I can't do that here can I?
  2. J

    Filter query that may contain null values

    PERFECT! Thank you again for all your efforts. I'm so grateful for this!
  3. J

    Filter query that may contain null values

    Stupidly "Unique Identifier" wasn't a number but I've changed that now. It works exactly as I want it to...well...almost :-) If I put a blank "Unique Identifier" then it picks up records that contain a "Unique identifier" as well. So searching for Patrick Henry returns records that should...
  4. J

    Filter query that may contain null values

    Ah, understood. I tried putting the code in a click event after the textboxes are updated. I got two errors that I've attached.
  5. J

    Filter query that may contain null values

    Thanks again :-) I tried this as rowsource of my listbox but I got the attached error: strSQL = "SELECT [Full Unitname] FROM CS WHERE " strSQL = strSQL & "Firstname = """ & Me.FirstnameBox & """" If Nz(Me.MiddlenameBox,"") <> "" Then strSQL = strSQL & " AND Middlename = """ &...
  6. J

    Filter query that may contain null values

    Yes, it seems to work :-) Thanks a million for helping me! However I want to use the query to find all records containing the specified name and display another column called "Full Unitname" in a listbox. Like this: Full Unitname Firstname Middlename Lastname Unique Identifier UnitAsia...
  7. J

    Filter query that may contain null values

    Yes, that was manually creating a query. I don't understand though, I've only ever created queries manually or as a rowsource. Should I put both pieces of code in an event code for example?
  8. J

    Filter query that may contain null values

    Thanks a lot :-) I still get a popup when creating and starting a query with it though. See attachment. Am I missing something in my installation of Access?
  9. J

    Filter query that may contain null values

    Thanks. I have some problems getting your code to work though :-) My Table is called CS and all textboxes are called ...Box so I added those the code...I also realized that the column UniqueID is actually called "Unique Identifier" with a space in it. I guess that changes the code a little as...
  10. J

    Filter query that may contain null values

    Hello! I have a problem that someone might know the answer for: I have a database with 4 columns (Firstname, Middlename, Lastname and UniqueID) I'm trying to make a query that filters out only certain people by typing names in textboxes. My problem is that Middlename and UniqueID may often...
  11. J

    Filter combo box to get "kansas" but not "arkansas"

    I've tried removing Like earlier but it made no difference. Could you give me an example for how the line should look?
  12. J

    Filter combo box to get "kansas" but not "arkansas"

    Hello! I have a combo box containing names of certain US states. When selecting a state in this box it filters results in another combo box using the selection as a criteria in a query. My problem is that when selecting "kansas" I also get all results containing "arkansas". I've tried using...
  13. J

    IIF function as criteria in a query?

    Great, that did the trick. Everything works fine now at about double the speed with the query vs loop function. Thanks a lot for all your help.
  14. J

    IIF function as criteria in a query?

    I got it to work with the looping function but it became so extremely slow that I'm now trying to get the query approach to work instead. My database has over 200'000 records, perhaps that's too big to run with the looping function. I've made two queries now, one that I use to find units from...
  15. J

    IIF function as criteria in a query?

    Almost there I think :) I put the declaration and the function in a normal module and got rid of most of the errors. However, now I get an error that says "Compile error: Expected end function" when I open the form. I shouldn't actually put "StateFound: FindState([Full Unitname])" as the...
  16. J

    IIF function as criteria in a query?

    I couldn't quite get it to work. I put FindState([Full Unitname]) as a criteria for my query but I get "Undefined function 'FindState' in expression" when I open the form. Also, I tried adding the code below to the On Load event for the form. But I got this error:
  17. J

    IIF function as criteria in a query?

    Thank you Galaxiom, you guys are worth your weight in gold :) I'm deeply grateful that you all take the time to help me out here. I'll try this as soon as I can. Probably in a few days. I'll let you know how it works out but, as you hinted, I'll probably go with the looping function. I imagine...
  18. J

    IIF function as criteria in a query?

    The problem is that the records I want to show with the "misc" menu item in my list are the ones that does not belong to any state at all. Because of this I would think that some sort of wildcard is the only option. For example, 1st Creek Cavalry Williams' Infantry Regiment Douglas' Cavalry...
  19. J

    IIF function as criteria in a query?

    No, the list contain only names of states. It's predefined as a value list in the combobox. It's my table (database) that contain a column with values like: 1st Virginia Infantry Regiment 2nd Pennsylvania Infantry Regiment 1th Alabama Infantry Battalion To sort out only units from Virginia...
Back
Top Bottom