Search results

  1. J

    Query field name that has ability to change?

    vbaInet - Thanks for your response. Are you saying if I want to be able to do that I would have to use SQL in VBA like: Dim strSQL as string strSQL = "UPDATE [Work-QP] INNER JOIN 4649 ON [Work-QP].[Item ID] = [4649].[McJ ID] SET [Work-QP].brc & forms!Myform.MyControl= [4649]![BRC] WHERE...
  2. J

    Query field name that has ability to change?

    In this instance, I use Access to manipulate data, not create a normalized database. My problem is that everytime I run through my saved queries, I have to manually redo my last update query because the field name changes. The field name that changes always begins with "BRC" then followed by a 3...
  3. J

    Opening recordset with parameter query results problem

    Error it couldn't find the table or query name. Me!headache = Now()
  4. J

    Opening recordset with parameter query results problem

    If I were to use the SQL code instead of calling the name of my query, how would I do that using your function?
  5. J

    Opening recordset with parameter query results problem

    My Query in "SQL View" is: SELECT [CO-DIV].* FROM [CO-DIV] WHERE ((([CO-DIV].SHIPTO) Like [forms]![frm_Queries].[FirstFive] & "*")) OR ((([CO-DIV].POINTER) Like [forms]![frm_Queries].[FirstFive] & "*")) OR ((([CO-DIV].PRICE) Like [forms]![frm_Queries].[FirstFive] & "*")) ORDER BY [CO-DIV].SHIPTO;
  6. J

    Opening recordset with parameter query results problem

    Thanks for the reply. The only reason I was using ADO is because I'm not familiar with exporting to Excel via DAO. So no real preference; whichever is easiest. I tried using your function simply by Private Sub Command3_Click() Call SendTQ2XLWbSheet("qry_profiles", "profiles"...
  7. J

    Opening recordset with parameter query results problem

    Hello All - Ultimate Goal = Exporting Query results to Excel Problem = Run-Time Error '-2147217904 (80040e10)' No value given for one or more required paramters The error occurs on red highlighted line in code below I know the problem is referencing my form control value as the parameter in SQL...
  8. J

    DAO adding 1 new field to 2 existing tables

    Thanks a million
  9. J

    DAO adding 1 new field to 2 existing tables

    How do I mark answered???
  10. J

    DAO adding 1 new field to 2 existing tables

    vbaInet - Your original code worked so I simply got rid of stuff until I couldn't anymore. the culprit was setting db = Currentdb() again (shown in blue below). Thank You! I'll mark as answered. - Just curious, should I "db = Nothing" before setting back to Currentdb() even if it isn't...
  11. J

    DAO adding 1 new field to 2 existing tables

    The code I posted is the consolidated code. Nothing is left out (well except stuff AFTER the failed line) and I know the rest of the code works because it's just a bunch more db.execute. So the code runs up until it hits that line i colored in red. All my code is in there before the...
  12. J

    DAO adding 1 new field to 2 existing tables

    Your code works like a charm when I only run those 2 peices. But when I put it in the middle of my code, it gives me the "Item not found in this collection" error on the red line below. Here is my whole code, because i know something bad happens in between the two sections of code you provided...
  13. J

    DAO adding 1 new field to 2 existing tables

    Thanks! looks a lot cleaner. Unfortunately... Dim db As DAO.Database Dim tdf As DAO.TableDef Dim fld As DAO.Field Set tdf = CurrentDb.TableDefs("MYtable") tdf.Fields.Append tdf.CreateField("MYfield", dbText, 30) ... Gives me an error. It fails on red line and gives error "Object invalid...
  14. J

    DAO adding 1 new field to 2 existing tables

    Thanks for the reply. I checked the spelling numerous times to no avail. What I did as a temporary fix was: dim db as DAO.database dim fld as DAO.Field dim tdf as DAO.TableDef dim db2 as DAO.database dim fld2 as DAO.Field dim tdf2 as DAO.TableDef And I used the first set of variables with the...
  15. J

    DAO adding 1 new field to 2 existing tables

    Before the experts ask why I would want to add fields via VBA, I am not building a typical database. I am importing large amounts of data into Access, having Access manipulate the data via queries and such, and exporting out. I use Access for the same steps pretty much everytime. (Bare with...
Back
Top Bottom