Search results

  1. D

    MS Error Compile Error User-defined type not defined"

    There is error in the logic where you build up strIDs. They should be built in the outer loop, not the inner loop so you would need to reverse the loops. As it is, by selecting more than 1 item in lstWorkReq you will corrupt the strID list.
  2. D

    MS Error Compile Error User-defined type not defined"

    I would use Microsoft Activex Data objects 2.8 Library
  3. D

    getting windows explorer to open a folder specified in a field entry

    google "SetForegroundWindow VBA" and you will see lots of examples.
  4. D

    MS Error Compile Error User-defined type not defined"

    In Tools / References make sure that you have "Microsoft Activex Data Objects n.n Library" selected. If not, select it.
  5. D

    insert statment not saving data to tables

    Are these local access tables or linked tables? Do the tables that you are inserting into have primary key index defined in MS Access? You may be able to troubleshoot silent failures using the following code: dbs.Execute sqlstr, dbFailOnError + dbSeeChanges debug.Print...
  6. D

    error 94: invalid use of Null

    Agreed, do this and you can use the Hour and Minute functions. You may also need to test CollectionTime for NULL using the nz() function. Private Sub Form_Current() Dim strCollectionTime As String strCollectionTime = Nz(Me.CollectionTime, "") If strCollectionTime = "" Then...
  7. D

    AC2007: Need two different values (string & number) from one function?

    Functions can return a Type that contains two values: Public Type IntStrPair strValue As String intValue As Integer End Type Private Function TestFn(ByVal pValue As Integer) As IntStrPair TestFn.intValue = pValue + 1 TestFn.strValue = "You passed " & pValue & " which is one...
  8. D

    How to import a directory listing into a table including dates and times

    This is an example of how you can get this ("Duration" is "Length" in Vista and Windows 7). Public Function GetExtendedAttr(ByRef fileName As String, Optional ByRef attrName As String = vbNullString) On Error GoTo ErrorHappened Dim oShell Dim oDir Dim oFile Dim intAttrID As Integer Dim i As...
  9. D

    How to import a directory listing into a table including dates and times

    You should use parentheses when calling functions, not subs. In the immediate window try: listQFiles "H:\SharePoint\" and listQFiles "H:\SharePoint\", True
  10. D

    UTC format to Local Time

    Assuming DEPT_TIME is a date, you would use: SELECT DEPT_TIME, UTCToLocal(DEPT_TIME) AS DEPT_TIME_LOCAL FROM xxxxx
  11. D

    UTC format to Local Time

    Copy the code below into a module and you can call UTCToLocal() to convert from a UTC datetime to the local equivalent. UTCToLocal() Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long Public Enum TIME_ZONE...
  12. D

    Is this an efficient way to accomplish this?

    Functions should really be returning the value rather than setting a global variable but this should do pretty much the same thing: Public Function ConThreshold(x As Currency) Dim rs As DAO.Recordset With CurrentDb Set rs = .OpenRecordset("SELECT ContributionThreshold AS CT...
  13. D

    Using VBA to search all tables in a database

    Maybe try this then: Public Sub SearchTables(SearchString As String) Dim tdf As DAO.TableDef Dim sTable As String Dim sField As String For Each tdf In CurrentDb.TableDefs sTable = tdf.Name sField = SearchTable(sTable, SearchString) If sField <> vbNullString Then If...
  14. D

    Using VBA to search all tables in a database

    Try using just text fields for now, number fields cannot contain letters. If rs.Fields(i).Type = dbText Then If InStr(1, rs.Fields(i).Value, SearchString) > 0 Then If MsgBox("Search Found in " & TableName & " field: " & rs.Fields(i).Name, vbOKCancel) = vbCancel Then...
  15. D

    Using VBA to search all tables in a database

    You are searching all field types, this will only look at text fields: If rs.Fields(i).Type = dbText Then If InStr(1, rs.Fields(i).Value, SearchString) > 0 Then MsgBox "Search Found in " & TableName & " field: " & rs.Fields(i).Name SearchTable = TableName...
  16. D

    Using VBA to search all tables in a database

    try changing the MsgBox line to: Msgbox "Search Found in " & TableName & " field: " & rs.Fields(i).Name
  17. D

    Closing Database Objects: Explicitly Required?

    RainLover, Thanks for the friendly advice, this will be my last post on this thread.
  18. D

    Closing Database Objects: Explicitly Required?

    ChrisO, If you still feel like this then I am okay to end this thread. All of these were before post 39 when I explained, appologised and thought we were okay to move on with a more positive thread. I did not appologize for "Grow Up". I am sorry. You were right, 24 hours was more than...
  19. D

    Closing Database Objects: Explicitly Required?

    Sorry, I think I may know where the confusion is. When I said "I am not sure why you say that he didn't say this" I was referring to your comment in the previous post (56) in which you said "That is not Chris's quote." Post 61 was for you and was explaining that it was his quote.
  20. D

    Closing Database Objects: Explicitly Required?

    Hi RainLover, I think you mean post 56. I answered this in line 1 of Post 57 and clarified it in post 61.
Back
Top Bottom