Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. kskinne

    VBA to conditionally delete rows - need faster method

    I was actually able to find what I think is a good solution to this problem in another discussion forum. Here is the updated code, which sets a range of just the rows that meet the needed conditions, then deletes that range, leaving behind the remaining rows: For i = LastRow To 3 Step -1 If...
  2. kskinne

    VBA to conditionally delete rows - need faster method

    I have some code containing a for next loop, which loops through the rows in my range in reverse from bottom to top, and conditionally deletes entire rows from my range, if condition 1, 2, 3, 4 or 5 are true. There is about 4,000 rows in my range of data. This section of the code is taking about...
  3. kskinne

    help with code used to update multiple records from datagrid

    Andy, here is the code I used to bookmark just the records I selected in the datagrid, to only update those bookmarked records, identifying them in the SQL update statement by their ID: Private Sub cmdMarkSelected_Click() 10 On Error GoTo cmdMarkSelected_Click_Error 20 If cboMarkAs.Text...
  4. kskinne

    help with code used to update multiple records from datagrid

    No worries Andy, I think ADODB will actually work great - so for in the testing I've done, using ADODB has eliminated the speed issues I was running into ADODC. I was able to use your ADODB code example to update all the records in my recordset, or update just one single record which I selected...
  5. kskinne

    help with code used to update multiple records from datagrid

    Although I wish I could just do this, I don't think this will work, because in my application, the user is manually selecting specfic rows in the datagrid they want to update. If you look back at the code I originally posted, those selected rows are getting bookmarked, and it is those...
  6. kskinne

    help with code used to update multiple records from datagrid

    Thanks Andy, this works as well - so then using ADODB what would be the proper syntax to update fields in the recordset, in order to update my database? Using ADODC I'm doing something like this for example: adodc1.recordset.fields(0).value = "some value" adodc1.update adodc1.refresh...
  7. kskinne

    help with code used to update multiple records from datagrid

    Andy, I apologize for my delay in replying. This should work, but for starters, I need some help on how to populate my datagrid with the data from ADODB recordset. Using ADODC, my code looks like this: Set DataGrid1.DataSource = Adodc1 DataGrid1.Refresh What would the correct syntax be...
  8. kskinne

    help with code used to update multiple records from datagrid

    Andy sorry for the delay in responding - I have no problem in using ADODB instead of ADODC, however I would definitely need some help in re-writing the code to use ADODB instead, including my code in other parts of the project that connect to the server and open the database in the first place...
  9. kskinne

    help with code used to update multiple records from datagrid

    Andy, I was wondering if that error was happening because my recordset I'm trying filter wasn't set to anything. So I decided to try inserting a new line of code: Adodc3.Refresh right after the line of code Adodc3.RecordSource = "SELECT paid, datePaid, comment, ID FROM c_CommPaid" Now with...
  10. kskinne

    help with code used to update multiple records from datagrid

    Andy, I used this line of code Adodc3.Recordset.Filter = "ID = 46942" and still got the same error on this same line
  11. kskinne

    help with code used to update multiple records from datagrid

    No, I do not. When I do what you mentioned above, my program opens, and then in my form I select the records and click the command button in my program that triggers this procedure to run, and that is when I get the runtime error.
  12. kskinne

    help with code used to update multiple records from datagrid

    If I start from within the project with full compile (ctrl+F5), the same thing happens, I get the error at run time when it gets to that line I mentioned above.
  13. kskinne

    help with code used to update multiple records from datagrid

    I do not get the error when I compile the code, I am just running the code from within my project, and at runtime I am getting error on the 'Adodc3.Recordset.Filter = "ID = " & cID line'. When I compile the code I do not receive a compile error, however I get the same runtime error when I run...
  14. kskinne

    help with code used to update multiple records from datagrid

    Sorry I missed that piece - when I type 'adodc3.recordset.', I am able to select 'Filter' from the intellisense drop down list. When I insert the msgbox line in the code, i get 'ID = 46942', 46942 is the ID in the database for the first record I had selected in the data grid.
  15. kskinne

    help with code used to update multiple records from datagrid

    Hi Andy - I'll be honest, trying to declare that string function as a variable did have me scratching my head. You are correct, the ID is a long integer, and it is in the 7th column of the data grid. I have removed the str function from the line of code, and here is my code as I have it now...
  16. kskinne

    help with code used to update multiple records from datagrid

    Andy what data type should I use to declare Str? If I add a declaration for Str without assigning as a specific data type, then I get a type mismatch error on that line "Adodc3.Recordset.Filter = "ID = " & Str(cID)
  17. kskinne

    help with code used to update multiple records from datagrid

    Andy I do have Option Explicit included in my code, but even if I leave this out, I still get the same error message on that line. And I get that same message whether I use "Adodc3.Recordset.Filter = "ID = " & cID" or "Adodc3.Recordset.Filter = "ID = " & Str(cID)"?
  18. kskinne

    help with code used to update multiple records from datagrid

    I did actually update that line, but I am still getting the run time error I referenced in my reply above. Thanks, Kevin
  19. kskinne

    help with code used to update multiple records from datagrid

    Thanks Andy - when I run the code you supplied above, I am getting runtime error on the line "Adodc3.Recordset.Filter = "ID = " & Str(cID)". The error message is "error 91 (object variable or with block variable not set)" What variable is not declared? I changed that line from...
  20. kskinne

    help with code used to update multiple records from datagrid

    I have the following code in a VB6 project, which is used to update certain fields within selected rows within a datagrid tied to an ADO recordset. We are running into issues where this code seems to run very slowly, taking several seconds just to update one of the records. Does anyone see any...

Part and Inventory Search

Back
Top