Recent content by izyrider

  1. I

    it's been a while :)

    not really new here, but Hi All, (especially to refugees from dbforums). izy
  2. I

    help with on-the-fly query as source for recordset

    is it something as banal as a parenthesis error? tought to diagnose, but here's a go at a count ('scuse the ugly syntax) strSQL = "SELECT TOP " & samples & " tblSampleRuns.RunDate, tblSiteVisits.SiteID, tblSampleData.ParameterID, tblSampleData.Value, tblSampleData.PracticalDetectionLimit, IIf...
  3. I

    sql in vba doesn't work...resulting string does work in query builder

    yes: %/* needs to be right but your concatenation was also wrong izy
  4. I

    sql in vba doesn't work...resulting string does work in query builder

    code version: ".....alarm_desc HAVING (((tempq1.CLLI)='" & strclli & "') AND ((tempq1.alarm_desc) like 'host to m*'))" there is a difference in code between concatenating 'string-literals' and concatenating '" & variables/controls holding string values & "' into your strSQL also ......" & "'"...
  5. I

    Is it numeric?

    the instrinsic function isnumeric() does the same?? BTW your original question seems to ignore the 00xxxxx possibility - maybe you want it that way. both KeithG's function (as posted) and the instrinsic will treat the 0 as numeric izy
  6. I

    how to check if docmd successful

    a small clarification: i should have said - replace ALL of docmd.setwarnings false docmd.runsql strQry docmd.setwarnings true with currentdb.execute strQry moving along: not a clue since i rarely visit the errors collection! Clear works on the err object ?? does it work on the...
  7. I

    how to check if docmd successful

    try currentdb.execute strQry it's faster it doesn't leave warnings off if the query errors and it is less typing! you are in JET? poke around at currentdb.recordsaffected immediately after .execute izy
  8. I

    Are there any hash functions available in VBA?

    CAPICOM provides MDx and SHA1 hashing easily accessible from VBA here is SHA1 late-binding Public Function Hash(ByVal strPlainText As String) As String Dim obHash As Object On Error GoTo err_Hash Set obHash = CreateObject("CAPICOM.HashedData") obHash.Algorithm = 0 'that's SHA1...
  9. I

    Combating apostrophes

    great that the workaround works :) if this is a thing that happens often, you might consider a dedicated function combining stripped-down aposWrite() & Replace97() functionality to avoid the call-of-call overhead. it's certainly not worth it for a single call to fill your one-off strSQL, but...
  10. I

    Combating apostrophes

    i can offer you a workaround: in a module public function aposWrite(strWithApos) as string aposWrite = replace(strWithApos, "'", "´") end function and then: strSQL = strSQL & aposWrite(rst!Surname) & "', " if the difference between O´Brian and O'Brian is offensive to your aesthetics you...
  11. I

    Round Funktion

    have a go with round( 2 * yourNumber, 1 ) / 2 izy
  12. I

    Is It Really Null?

    for many values: X and Y or B <> (X and Y) or B <> X and (Y or B) try a few parentheses. meanwhile, (and you should play with parentheses anyway for the exercise): [Status] Not Like "Complete" Or [Status] Is Null could be replaced with nz([Status], "") not like "Complete" izy
  13. I

    RunSQL Action Query Error

    unless i'm missing the plot somewhere, you are trying to construct a string that is going to work with docmd.runsql "your string goes here" your posted code simply should not work! if you do the "swap' and fix the leftover ) it should work in SQL-view of query analyser, but it certainly...
  14. I

    RunSQL Action Query Error

    if you're happy, i'm happy. no way it runs as posted with only the " for ' swap tho. izy
  15. I

    RunSQL Action Query Error

    parenthesis count (i hope you understand my "syntax"): DateDiff("yyyy",[DOB],Now()) 0000000011111111111111111210 +Int(Format(Now(),"mmdd")<Format 00001111111222232222222211111111 ([DOB],"mmdd")))' 222222222222210x izy
Top Bottom