Search results

  1. P

    Variables in a query

    I have gotten the dropdowns to change properly, Where I am struggling is when the query reaches back to look at the current state of the combo box, it doesn't seem to like the all option.
  2. P

    Variables in a query

    I have a UNION SELECT 0, ' All' FROM tblBrands so that I get an all option in my dropdown. I also have a [Forms]![frmMain]![cboBrands] in my query criteria to filter results from the combo box. When all is selected, I get no results. I'm thinking I need an if statement. if all is selected, run...
  3. P

    unbound field in query

    Added some spaces before quotes and an extra 0 in the select statement. BrandsSource = "SELECT [tblModels].[Model_ID], " & _ "[tblModels].[Model_Name], " & _ "[tblModels].[Brand_ID] " & _ "FROM tblModels " & _ "UNION " & _ "SELECT 0, ' All', 0 " & _ "FROM tblModels "
  4. P

    unbound field in query

    I tried adding a select all into this but get a FROM error any idea what is causing this? Dim BrandsSource As String If Me.cboBrands.Value = " All" Then Me.cboModels.Value = Null BrandsSource = "SELECT [tblModels].[Model_ID]," & _ " [tblModels].[Model_Name]," & _ " [tblModels].[Brand_ID] " &...
  5. P

    unbound field in query

    Time to admit the stupid simplicity of my error. Being base 0 and needing the ID, I was searching Column 2 which did not exist when I needed to be looking at 0. Dim BrandsSource As String BrandsSource = "SELECT [tblModels].[Model_ID]," & _ " [tblModels].[Model_Name]," &...
  6. P

    unbound field in query

    yea, I noticed that too... Sorry, JS background. SQL confuses me:banghead:
  7. P

    unbound field in query

    ok, thinking out loud... I should have been in the WHERE not the SELECT.
  8. P

    unbound field in query

    I think I posted a screenshot of layout. I'm trying the following code to filter the second combobox. Dim BrandsSource As String BrandsSource = "SELECT [tblModels].[Model_ID].Column(2)," & _ " [tblModels].[Model_Name]," & _ " [tblModels].[Brand_ID] " &...
  9. P

    unbound field in query

    I went back and edited it to say column but you replied too quickly. I found this on a SO page that I'm going to try. YourVariable = Me.cmbEmps.Column(2) if that fails I will make a picture.
  10. P

    unbound field in query

    I have a form that has 2 combo boxes so far (brand and model). I need model to filter when brand is chosen and I need to pull the data for a query. when the bounded column is 1, my combo box filter works. when bounded column is 2 my query works. Is there a way to leave it at 1 and make the query...
  11. P

    drop down select from another table

    Im going to fiddle with your example at home with a cleaner DB. I have been learning Access and database stuff while building this project so there is a lot that isn't done right but works. One thing I noticed while fiddling was that not all of the records were showing up. Over the last week...
  12. P

    drop down select from another table

    Ok, rebuilt the subform, Tinkered around a bit. started undoing my changes and it started working. I have no idea what fixed it, my co-worker says F'ing Magic.
  13. P

    drop down select from another table

    I'm wondering if with all the changes to the table that maybe I should rebuild the subform. I may be working in circles right now.
  14. P

    drop down select from another table

    Ok, fresh eyes. Lets see If I can figure this out today. vbaInet: I didn't know you could do an excel front access back. I knew the reverse was possible. Anyhow, it is all in access. This project is converting a bunch of excel stuff into one database where the reports make themselves. As for...
  15. P

    drop down select from another table

    I had 3 drop down filters that worked when the word being filtered was written in the table. I have since then linked them to new tables to be more database-y. The problem I have found (a couple weeks later too) is that my drop downs broke. It makes sense why, they are now 1,2,3,4 instead of...
  16. P

    divide by 0

    Sweet, it's working now! Still like sticking in Photoshop but this is getting less scary.
  17. P

    divide by 0

    Awesome thanks. I noticed the alignment difference after trying to figure out what you said and dug a bit. It was throwing me off because I got the data from a count which I assumed would be a number. It was. When I did the Nz, it changed it from number to text and I never noticed. Now i...
  18. P

    divide by 0

    How do you know they are text and can they be type cast as a number? As for the can be null, I have them fed with 2 queries that are built off the same MDS list and Nz'ed to add 0's in place of nulls. Is this not a good solution?
  19. P

    divide by 0

    I decided to start in its own query so there would be less clutter. I also added new image showing nothing is null. The query that feeds this one does a Nz on the data encase that causes issues. New SQL SELECT listLD.MDS, listLD.contLDWith0, listCBI.contCBIWith0, IIf([contLDWith0]>0,0,11111)...
  20. P

    divide by 0

    -Brianwarnock I did not know that. Can I do a traditional if/then statement like in other languages? All I have seen are IIF. -plog off to meeting. Will try your suggestion when done. Thanks
Back
Top Bottom