Recent content by JonAccess

  1. J

    Running queries in a sequence based on form - VBA

    lagbolt - I don't have the SQL handy at the moment, but it would accomplish something of this sort... UPDATE [Use_Cost] WHERE [Cost1] Is Not Null UPDATE [Use_Cost] WHERE [Cost2] Is Not Null; [Use_Cost] Is Null etc.. The logic is that in some parts of the world, Cost1 will be more accurate...
  2. J

    Running queries in a sequence based on form - VBA

    Good ideas. I think I'm going to try to use a listbox with the options being the name of my saved queries. Might add a "Move up"/"Move down" button to the listbox to help set the order of queries to execute. then run a loop with ElseIfs or Select Cases to run the queries in the order...
  3. J

    Running queries in a sequence based on form - VBA

    I imagine that sorting the order list on a form is the way i may go. Is there a way i can do this with a listbox or something? Ex. Have a listbox with "Cost1", "Cost2", etc. and be able to drag and drop each cost into the order i want? And then in VBA be able to say "Run query for 1st item in...
  4. J

    Running queries in a sequence based on form - VBA

    Maybe I should also say that I'm wanting to decide the sequence of the queries to run in VBA by selecting the order via a form. Ex. Putting a "1" beside the query i want to run first, etc.? I know there has to be a better way!
  5. J

    Running queries in a sequence based on form - VBA

    Let's say I have 10 saved update queries that I use to manipulate imported data. These queries update a "Cost" field in order of the quality of costs I have available. The query logic is as follows: Update "Cost" if i have a cost in "Cost1" If "Cost" is still empty, Update using "Cost2" If...
  6. J

    Putting Unique Query Results into Variables; VBA?

    Is there not a way to say for example...1. Open Query2. Loop through and put 1st value in variable13. Loop through 2nd value and stick it into variable24. If EOF then stop looping?
  7. J

    Putting Unique Query Results into Variables; VBA?

    I have saved queries because I'm using Access as a "middleman" and manipulating imported data and then exporting it. I have a process i go through everytime to get the raw data in the desired results and I'm trying to automate it. I have the queries run in order by the db.execute method...
  8. J

    Putting Unique Query Results into Variables; VBA?

    P.S. My query name is "qry_BRC" and the field with unique values in the query is named "BR"
  9. J

    Putting Unique Query Results into Variables; VBA?

    Hello! I have a query that returns unique values of one field. There can be from 1 to 10 unique values that are returned. Ex. 099 and 010 could return one day. And 002, 110, 956, 010, 099 could return another day. I want to be able to put each returned value (however many) into an...
  10. J

    DoCmd.OpenForm WHERE problem

    I checked my forms record source and saw that it was based on some funky SQL statement that I didn't know where it came from. I just based the form off of the table and our original code works! Thank you for tipping me off to the record source. Wonder why that funky record source was in...
  11. J

    DoCmd.OpenForm WHERE problem

    If I take out the whole reference to "Customer_Name" then Access prompts me for a parameter for field "Customer_Name" Wonder what causes that?
  12. J

    DoCmd.OpenForm WHERE problem

    BTW, My strWhere variable is supposed to be on one line. strWhere = "forms!frm_Main_Cust_Data![Customer_Name] like ""*" & Me![cust_#] & "*"""
  13. J

    DoCmd.OpenForm WHERE problem

    I do not know what is wrong with my code and thought I needed a different set of eyes. When I run this code, it opens up the form, but filters to show a blank record instead of the matching record. I'm guessing, for some reason, what I'm searching for doesn't match anything in my records. Any...
  14. J

    Query field name that has ability to change?

    vbaInet = GENIUS!! br is a text field so I wrapped that concat in extra single quotes and it worked! (Even though the field I'm updating TO is a number field) Private Sub Command40_Click() Dim strSQL As String strSQL = "UPDATE [Work-QP] INNER JOIN 4649 ON [Work-QP].[Item ID] = [4649].[McJ...
  15. J

    Query field name that has ability to change?

    vbaInet - I think it's trying to work , but it's giving me a Run-time error '3464' Data type mismatch in criteria expression. Do I have to change the data types of some of my fields or what?
Top Bottom