Search results

  1. S

    DoCmd.SetParameter Help

    Sorry...took the weekend off! The error message I get is "Run-Time error "2498"; An expression you entered is the wrong data type for one of the arguments" When I select "Debug" it opens the VBE and the following row is highlighted DoCmd.SetParameter "Country_Code", Me!Text120 Text120 is a...
  2. S

    Difference between Access VBA & SQL

    Again, not sure if I am using the right terminology when I reference the "front-end" menus driven view/functionality of Access versus the behind the scenes SQL but is the front end enough to get thinsg done or does SQL really help queries with their functionality and/or performance? Thanks for...
  3. S

    Difference between Access VBA & SQL

    Stupid question but I guess that asking the stupid questions helps us get smarter! What exactly is the difference between SQL and Access VBA? I guess the next logical question is why does MS Access make it possible to code with either? If you were advising an Access user on which to use and...
  4. S

    Dynamically add fields to SQL or query based on form selection

    It runs but I get no results returned and I think it is because "All" is a default value on the form in the combo boxes to let the user know that for that field, it is defaulting to pulling everything for that field. In Other words, in Region if left as "All" data for all regions will be in the...
  5. S

    Ignore Query Fields Depending on Form Selection

    HI CJ, Interesting and helpful resource. Thank you
  6. S

    DoCmd.SetParameter Help

    I must have this wrong because it keeps returning an error message when I try to run the command button. For the life of me, I have researched how to use the DoCmd.SetParameter and it is set up exactly how I have seen it used. Please advise.... * "Country_Code" is a field in the query to be...
  7. S

    Ignore Query Fields Depending on Form Selection

    Do you recommend a good source for learning more about writing queries using SQL and VBA? No issues with how tables relate to each other but advancing beyond simply using Access windows driven "coding" for more advanced coding is out of necessity to provide more dynamic capabilities...and that...
  8. S

    Ignore Query Fields Depending on Form Selection

    As an update, I changed the VBA for the form button to Private Sub Command126_Click() Dim vFields Dim vValues Dim where As String Dim i As Integer vFields = Split("Function Country_Code Cost_Center Geography Region Budget_Region Legal_Entity") vValues =...
  9. S

    Ignore Query Fields Depending on Form Selection

    Ha! I guarantee that I am! Here is the SQL if that is what you prefer to view. SELECT REF_ACT_Expense_Current_Final.Category_Sort, REF_ACT_Expense_Current_Final.Category, DSum("[Functional_USD_Amount]","REF_ACT_Expense_Current_Final","[Month_Name] = '" &...
  10. S

    Ignore Query Fields Depending on Form Selection

    Could it be related to the fields that I am summing using a DSum function? Here is what I have for the CurrentMonth field CurrentMonth: Sum(DSum("[Functional_USD_Amount]","REF_ACT_Expense_Current_Final","[Month_Name] = '" & [Forms]![Frm_PARAMETER_Metrics]![CboMonthName] & "'")) The gist of...
  11. S

    Ignore Query Fields Depending on Form Selection

    Thanks CJ, Unfortunately, that was the setup when I first created the query. I had those fields in the query but unticked the "Show" button for those fields and was still getting 3,815 rows. The only thing that works to limit the query results is specifying the categories to include and that is...
  12. S

    Ignore Query Fields Depending on Form Selection

    Thanks PBaldy! Enclosed are two pdf files showing the results of the query behind the report. In the first, the columns whose headers are shaded in orange should not be appearing (I only printed one page to pdf to provide an example. It is actually 66 pages if I printed the whole sample)...
  13. S

    Dynamically add fields to SQL or query based on form selection

    I appreciate it. I do see what we are doing. I think once it is completely working as envisioned it will allow me to work my way back through the coding to understand each component and learn from it. It is definitely cleaner than how I first had it and I appreciate your help. Here is where I...
  14. S

    Dynamically add fields to SQL or query based on form selection

    COuld it be because the query doesn't know what to do with "All" as a criteria? For example, the default on the combo boxes is "All" for aesthetic reasons/avoid confusion to the user type of thing but does the codign you provided tell the query that if a combo box = "All" all that really means...
  15. S

    Dynamically add fields to SQL or query based on form selection

    Thanks Mark, I appreciate the help. I get an error on this part of the code DoCmd.OpenReport " Query1", acViewReport, , where
  16. S

    Dynamically add fields to SQL or query based on form selection

    Dear MSAccessRookie, Any chance we can revisit this thread? What you are describing sounds exactly like what I need to figure out but I am not able to apply what you listed as a solution to my specific situation. Here are the details that I think are relevant. I have the following: * Criteria...
  17. S

    Ignore Query Fields Depending on Form Selection

    Is there a way of uploading a pdf that shows a sample of the query results?
  18. S

    Ignore Query Fields Depending on Form Selection

    Hi CJ, That is correct. What I have is a form with various geographic variables to select from and a reporting month selection that gives a time period. If none of the geographic variables are selected on the form then the result will be totals for global consolidated. If "Americas" is selected...
  19. S

    Ignore Query Fields Depending on Form Selection

    That works but now I get an "Enter [Region]" message when I press run on the criteria form which feeds the query behind the report. It seems like now that I am using a Where clause it is searching for the Region field? Prior to adding the Where clause the code behind the run button (re-listed...
  20. S

    Ignore Query Fields Depending on Form Selection

    Part of the problem is that I have the CboRegion default to "All" if nothign is selected so I figure I need to use an IIF in the Where clause of the query? WHERE...
Back
Top Bottom