Search results

  1. I

    CopyFromRecordset does not keep sorting of recordset

    Cloning the recordset gives the same result: the output is in the original order, not the sorted order Requering the recordset results in an error "operation is not allowed in this context" The recordset is not based upon a query. In meantime I found some solution, maybe not the best, but it...
  2. I

    CopyFromRecordset does not keep sorting of recordset

    All I have sub below which exports an ADODB-recordset to Excel. Before the export, the recordset is sorted. In the loop I print out the supplier name in the Immediate window where the values are indeed sorted upon supplier name. However, in Excel the records are in the original order instead...
  3. I

    Hide Password in Input Box

    Actually I was aware, but now others will have a MDB which will work immediately without changing any code. That was my purpose but I did not describe this well.
  4. I

    Hide Password in Input Box

    All I converted the code so it is now usable in both 32bit and 64bit of MsAccess
  5. I

    Listbox "before update"-event

    All I have a listbox where all of the values are selected by default on opening the form. The user is able to (de)select values, but there must always be at least 1 value selected. What is the target? Suppose there is currently one item selected. If the user deselects it, that specific entry...
  6. I

    Rowset does not support fetching backward

    All I have next code. An error "Rowset does not support fetching backward" occurs on line rs.movelast. I've tried all possible values for rs.CursorLocation. Does someone have a solution? The recordset contains the requested records and I can navigate by using rs.MoveNext.
  7. I

    Auto Updating Frontend WinXP Problem

    This is most probably caused as XCOPY in XP does not support UNC-paths. I can't test it from my current computer, but I think it can be solved by using @ECHO OFF pushd \\REMOTE cd "Database Trial" ECHO Please Wait while latest Database is copied from server ECHO f | xcopy /F /Y /D "Database...
  8. I

    objXL.Workbooks(1).FileFormat

    It works on my computer with Function DetermineVersion(intFileFormat As Integer) As Integer Select Case intFileFormat Case xlExcel9795 DetermineVersion = acSpreadsheetTypeExcel97 Case xlExcel7 DetermineVersion = acSpreadsheetTypeExcel7 Case...
  9. I

    objXL.Workbooks(1).FileFormat

    Your code is correct. 56 is indeed for XLS. 5 is for Lotus 2.x-files See also http://www.convert-files.com/SII/Convert-XLS/English/WebHelp/command_line_manual/file_type_constants/rhid_excel_conversion_file_type_constants.htm
  10. I

    How to automatically set cursor to first record (in subform of a tabcontrol)

    Yes, that's indeed true. But I tried to place my code in the events "on open", " on load", "on activate", "on got focus", ... I now figured out I have to put it in the "ON ENTER" event of the subform-control in which the subform is displayed.
  11. I

    How to automatically set cursor to first record (in subform of a tabcontrol)

    All I have a form called frmMain. This form contains a TabControl named tabMain tabMain has some pages. One of the pages is called pagRecords pagRecords contains a subform called frmRecords. frmRecords contains records from an in-memory table. My problem: If I select tab pagRecords the...
  12. I

    in memory ADO-recorset: no current record

    There is actually one more thing: the code in the referenced article works except if all of your input fields are comboboxes (which is true in my case). In my previous test, these were still text boxes. In this case it seems you have to select your value twice as from the second record you try...
  13. I

    in memory ADO-recorset: no current record

    Thanks, the referenced article contained the solution. I did not had the code in the "before insert"-sub. I can now add records in the form without problems.
  14. I

    in memory ADO-recorset: no current record

    All I use MS Access 2010. I have code below and created a form with two textboxes where property "control set" is set to "first" and "last" respectively. I enabled the reference "Microsoft ActiveX Data Object 2.8 Library". Private Sub Addnew(ByRef rstADO As ADODB.Recordset, strFirst As...
  15. I

    Date and Time Functions not using current info

    Did you perform a search-command through your whole project on the words date and time? In Access 2013 it is possible to tweak the system command Time. This does not work for Date in Access 2013 (but it might be in former versions). Open a new access database and press ALT+F11 to go to the...
  16. I

    dbs.Execute being "ignored" by access

    Your SQL-command is incorrect. Assuming ID is defined as a numeric field and Description as text, you must use strSQL = "INSERT INTO OTOTBL(ID, Description, OTO) VALUES(" & Me.Id & ",'" & Me.Description & "', 'OTO')" This results in e.g. INSERT INTO OTOTBL(ID, Description, OTO)...
  17. I

    SQL String does not retrieve Primary key newly added record

    All I have an Access 2010-form which inserts a record in a MS SQL 2008-database by using an ADODB-connection. I need to retrieve the primary key of the newly added record. With code at the bottom I create a SQL-string which is stored in variable strSQL. If I execute the SQL-string...
  18. I

    Deleting rows in Excel

    Hereby the full code which works on my computer Sub ExcelFormat() Dim excelApp As Object Dim excelWB As Object Dim excelWS As Object Set excelApp = CreateObject("Excel.Application") Set excelWB = excelApp.workbooks.Open("Z:\Data\Test.xlsx") excelApp.screenupdating = True excelApp.Visible =...
  19. I

    Deleting rows in Excel

    If I interpret your question correctly, this should be something like Sub ExcelFormat() Dim oXL As Object Dim wrk As Object Dim sht As Object Set oXL = CreateObject("Excel.Application") Set wrk = oXL.workbooks.Open("c:\temp\file.xls") oXL.Visible = True Set sht = wrk.worksheets("testData")...
  20. I

    Error 3265: Record not found in collection

    I think you need to use With frm(strField).ControlSource If (frm(strField).Required Or (frm(strField).ValidationRule Like "*Is Not Null*") Then
Top Bottom