Search results

  1. W

    Next Try

    a more workable version of what you have though (although I agree with pat that you should probably look at table structures etc) is Private Sub MM1_YY_LostFocus() Dim strDate as String, strCell As String Dim intMM as integer, intYY as integer, intCount as Integer, i As Integer strDate =...
  2. W

    Repeating Code

    i wonder if using vbWhite and vbGrey will do what you want as well (these are predefined colours for things like textbox backgrounds etc)
  3. W

    Can you use SQL in VBA code?

    hmm... ok, try something like this as the sql statement sql = "SELECT COUNT(*) FROM <tablename> WHERE " & a & " IN ('1','2','3','4','5','6','7','8','E','A','B','N','W','D','T','Q')" This will find all the records in the table that has your criteria in fieldname a, and count how many records...
  4. W

    Can you use SQL in VBA code?

    Dim rs as DAO.recordset Dim sql as string <Set up your sql statement here and store it into the string sql> Set rs = CurrentDB.OpenRecordset(sql) then you should have no trouble getting the value out of the recordset hope that helps
  5. W

    "Error in loading DLL" when looking for Outlook

    Set olAppWide = New Outlook.Application
  6. W

    array questions

    Multidimensional array Diim arrayname (X, 2) As for looping through the array, look into the LBound and UBound functions Hope this helps EDIT, a brief look deeper revealed these Dim arrayname(2, X) for a 2 column, X row array and Dim something as Varient For Each something in arrayname...
  7. W

    please help with a "where" statement

    WHERE (([EMPLOYEE SHIFT].SHIFTNAME) ='"& Me.SHIFTNAME & "')); " try the above
  8. W

    please help with a "where" statement

    well, the most glaring ommission is what you are going to compare the shiftname to in the where clause. You should have ([EMPLOYEE SHIFT].SHIFTNAME = <some comparison here>)
  9. W

    calculate Double OT

    umm... sounds like you really want a spreadsheet, not a db
  10. W

    CurrentRecord equivalent in ADO

    ok.. if you want to use an ADO recordset, then why not try the following as the recordset command(s) Dim conn as new ADODB.connection Dim rs as ADODB.Recordset conn.connectionstring = <your connection string> conn.open Set rs = conn.Execute("SELECT SUM(QtyGood) AS Total FROM <table>")...
  11. W

    Search function problem

    tis ok. I like to help, and also like to give people the fundamentals of SQL, as it helps for if they ever use a DB other than access
  12. W

    Another Text Manipulation Question...

    You need to be able to define exactly how the firstname is going to be obtained, then make sure the code follows this. Computers, unfortunately, can't yet look at a string and say 'this is the firstname and this is the lastname' without being told exactly how to get the firstname, and exactly...
  13. W

    Subscript out of range - Arrays & NPV

    or maybe you need to do ReDim NPVarray (-1 to Count)
  14. W

    Subscript out of range - Arrays & NPV

    hmm... looking again. do you need to pass NPVarray() or NPVarray ? It could be complaining because you are giving the subscript reference symbols(read - brackets) without giving a reference.
  15. W

    Subscript out of range - Arrays & NPV

    wouldnt using a for loop make more sense here? For n = 0 to count NPVarray(n) = value Next n seeing as you are using the while loop as a for loop anyway
  16. W

    Search function problem

    umm... upper and lower case are important when doing sql searches... the criteria is case sensitive anyways. Should probably check that out.
  17. W

    Search function problem

    hmm... upper and lower case correct as well?
  18. W

    open folder from hyperlink

    I wasnt questioning that it works, was just wondering why you have an argument thats overwritten with a public variable with 2 lines of code
  19. W

    Search function problem

    ok... are you searching for an exact match? if not, use [field name] LIKE '*string*' don't you love sql? :)
  20. W

    Search function problem

    ah yeah... lovely lovely access. If it has a space in the fieldname, put the field name in square brackets, like so [field name]
Back
Top Bottom