Search results

  1. S

    query multiple field

    Hi, A join like this should work: strSqlContactEvent = "select tblcontact.contactname, tblcontact.contactid from tblcontact INNER JOIN tblEvents ON tblcontact.contactid = tblEvents.contactid where tblEvents.eventid = " & lstEvent.Value hope that helps, Simon B.
  2. S

    New in Databases

    Hi, I'd try this: H t1 LEFT JOIN (I t2 INNER JOIN J t3 ON t2.ev = t3.ev AND t2.p = t3.p) ON t1.HI = t2.HI Simon B.
  3. S

    Query With Multiple Wildcards in Multiple Fields

    Hi, I think your problem is here: ((InspectionRecords.InspectDate) Between "#01/01/2000#" And "#01/01/2040#") is InspectDate of type Date or Text? If Date, no " , if Text no #. Simon B.
  4. S

    Alternate to Replace() in access 97

    Hi, Have a look there: http://www.mvps.org/access/strings/str0004.htm That might be your solution. Simon B.
  5. S

    Using AND in INNER JOIN

    Hi, I'm assuming that the combination of LOG_ID and SERVICES_ID is unique in SERVICESLINKS. If so, the following query should do what you want: SELECT DISTINCT * FROM LOG WHERE LOG_ID IN (SELECT LOG_ID FROM (SELECT SERVICELINKS.LOG_ID, Count(SERVICELINKS.LOG_ID) AS CNT_LOG_ID FROM...
  6. S

    Joining 2 queries.

    Hi, Missing brackets (in red) SELECT * FROM [All Rejections Query] INNER JOIN [Totals Query] ON [All Rejections Query].ID = [Totals Query].ID BTW, a good practice is to NOT use spaces in object names. Simon B.
  7. S

    Joining 2 queries.

    Hi, Do you have some kind of ID in both queries? Something like patient ID or number? If so the syntax for your record source would look like this: SELECT * FROM query_1 INNER JOIN query_2 ON query_1.ID = query_2.ID Hope that helps, Simon B.
  8. S

    Cartesian join in Access

    Hi, A cartesian JOIN can be done with this syntax: FROM Qry_Sub2_TotalCommPdByCustID, Qry_Sub2_TotalInvByCustID Remember that this will give you EVERY possible combination of query_1 and query_2, so num_row_qry_1 X num_row_qry_2. Is this really what you want? Simon B.
  9. S

    Check if excel workbook is protected before opening it

    Hi, This will work: Public Sub TestExcel() On Error GoTo TestExcelErr Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim strFileName Set xlApp = CreateObject("Excel.Application") strFileName = "C:\ADSB\my_excel_file.xls" Set xlBook =...
  10. S

    Need help with Update Query

    Hi, I do not really understand what is the goal but this query would work assuming that Company Code is of type Integer and Reserve Amount is a Double: INSERT INTO Table1([Company Code], [Reserve Amount]) SELECT 12, SUM([Reserve Amount]) FROM Table1 WHERE [Company Code] IN (1, 5, 6, 7, 8...
  11. S

    Copy B/E table from F/E

    Hi again, Since I wanted the structure only to be copied I found a way to do it. DoCmd.TransferDatabase acImport to import the structure to the F/E and then DoCmd.TransferDatabase acExport to export it with the new name to the B/E Seems to work fine. Simon B.
  12. S

    Copy B/E table from F/E

    Hi there, I'd like to know if there is a way to programmatically copy a table that is on the back-end (both the original and new table are on the back-end) by running code on the front-end. I will then link that new table to the font-end. Thank you, Simon B.
  13. S

    Automatically add module to new DB

    That's nice!!! this is exactly what I wanted, however we are not going to have Access 2007 at work anytime soon....
  14. S

    Automatically add module to new DB

    That's a good idea, not quite what I wanted, but that could do it Thank you very much, Simon B.
  15. S

    Automatically add module to new DB

    That's exactly what I did not want to have to do... Thanks, Simon B.
  16. S

    Interesting Duplicates Issue

    Hi, Could you post you query (in SQL) and a sample of what you expect as a result?
  17. S

    Automatically add module to new DB

    Hi, Is there a way to configure Access so that it automatically adds a specific module (.bas file) when creating a new DB? Same thing would be useful for References... Thank you, Simon B.
  18. S

    Check if UserName is in UserID field in table

    Hi James, Environ$("Username") will give you the username of the person currently logged on the computer. There are other Environ variables available that are worth looking at. Simon B.
  19. S

    Please Help

    Hi, If you have it in a query try: [postcode] like [enter post code] & '*' You should always be using ' instead of " in SQL, for portability. Simon B.
  20. S

    Please Help

    Hi, Your query should look something like this: SELECT field1, field2, ... FROM your_table WHERE Left(postcode_field, 2) = 'what_you_want' or SELECT field1, field2, ... FROM your_table WHERE postcode_field LIKE 'XX*' Is that what you need? Simon B.
Back
Top Bottom