Recent content by Samoan

  1. Samoan

    Need Help with Delete Query

    How about DELETE * FROM Dogs WHERE FirstStop not in (SELECT location FROM PlacesToGo) AND SecondStop not in (SELECT location FROM PlacesToGo)
  2. Samoan

    filtering to display one entry per row

    This may work for you: Select your_columns from table1 A where A.date = (select min(B.date) from table1 B where A.project = B.project)
  3. Samoan

    Querying Null Date Value

    All right, in looking at your data and reading your post I think I understand. Try this in your query: AND IIF([Forms]![frmarchivesearch]![txtinvdatefrom] Is Null, nz((tblArchive.DateFrom),"0") like "*", (tblArchive.DateFrom) Like "*" & [Forms]![frmarchivesearch]![txtinvdatefrom] & "*" What...
  4. Samoan

    Querying Null Date Value

    There are certainly multiple ways to solve this problem, and creating a query definition on the fly may be one of them. I sometimes will store SQL in a string, and then use that string as a record source for the form that will return the data to the user. For instance: strSQL = "SELECT * from...
  5. Samoan

    Querying Null Date Value

    It might help if you give a couple lines of data, and what data you expect to be returned when the date box is null, and what data would be returned when the date box is not null.
  6. Samoan

    Querying Null Date Value

    Something like this may work for you. Replace AND (tblArchive.DateFrom) Like "*" & [Forms]![frmarchivesearch]![txtinvdatefrom] & "*" with AND IIF([Forms]![frmarchivesearch]![txtinvdatefrom] Is Null, (tblArchive.DateFrom) Is Null, (tblArchive.DateFrom) Like "*" &...
  7. Samoan

    Building simple query, but can't get it right

    You will need to put sub selects in your query. The WHERE statement should look something like: WHERE your_date_criteria >= (SELECT max([Year]) - 4 from [1 Balance Sheet]) AND your_date_criteria <= (SELECT max([Year]) from [1 Balance Sheet])
  8. Samoan

    Recordset Problem

    Does the table you are inserting into require data to be in any or all of those fields? Do you get an error message when the insert fails?
  9. Samoan

    Finding data w/ more than 2 decimals

    You could try this: SELECT * FROM MyTable WHERE len(mid([MyTable].[MyNumber],instr([MyTable].[MyNumber],".")+1)) > 2; It would probably be easier to do this in the SQL view as opposed to the design view.
  10. Samoan

    Don't want to see all the forms open at once. Help!

    In the Form Load event for each form you could add the following line: DoCmd.Maximize
  11. Samoan

    Update Using Combo Box in Datasheet Form

    You know, I see a million posts about the whole combo box bound column thing, but I never really understood how it worked. All it took was for Pat to pretty much tell me exactly what to type. Embarrassing, but I appreciate the help.
  12. Samoan

    Update Using Combo Box in Datasheet Form

    Well, I've come up with a work around, although it seems a bit tedious. I added code to the Get Focus event of the Department combo box to unbind that field (set the ControlSource to ""). I then added code to the On Change event to grab the Department ID that is now in the field and update my...
  13. Samoan

    Update Using Combo Box in Datasheet Form

    I have a datasheet form that is used to update existing data in a table. One of the fields that can be udpated is Department. On the table I'd like to update, the DepartmentID is stored. The DepartmentName is stored in a seperate table. I would like to use a combo box so users can select...
  14. Samoan

    Updating Field (But only part of it)

    If you are using Access 2000, you should have the replace function. Using your example, the query would be: UPDATE tblMyTemporaryMadeUpTable SET MyField = replace(MyField,"A","B")
  15. Samoan

    Making a Event after a specific date

    The day() function can be used on a date to return the day number. For instance, day(2/1/2004) would return 1 (note I'm using U.S. date format, don't know where you're at). day(5/25/2004) would return 25, etc... If you wanted to get the day number of the current date, you could use...
Back
Top Bottom