Search results

  1. M

    Update query in VBA

    Hi there, It's been a while. I've never used an Update query before, but I have a perfect requirement for one now. I have a form (frmOrders) with a subform (frmProduct_OrderAmount) in it. Linked by the Order number. When I do a new order, I enter the products for that order by use of the...
  2. M

    Which loop to use?

    Hi there, I am sorry, I had been playing with the code before I pasted it in, you're right, it would return the first from the code I pasted. I actually got around it by finding a function called "MaxInArray" and using along with a another case statement, so no loops are used now. I will mark...
  3. M

    Which loop to use?

    Thanks for that, but there would still need to be an array as it would hold a value for 5 different things. I probably didn't explain properly - There is a value for 250 Hz, 500 Hz, 1 kHz, 2 kHz and 4 kHz So these will need to then be stored somewhere so that I can then find the lowest one...
  4. M

    Which loop to use?

    Unless, of course, I don't need to loop and I just need something like MaxOfValue? I.E: U > E > D > C > B > A
  5. M

    Which loop to use?

    SOLVED: Which loop to use? Hi there, I'm trying to work out which loop I need to use or if I need to use a mix of loops. The context is as follows: I have a table of absorption values for each material. I have a button which calculates which class of absorber the material is, based on its 5...
  6. M

    Reading Access Database in Excel

    Thanks both for your help. You made me realise that I don't need to use ID fields in every lookup field that I do, so I edited each lookup query in the main table so that it just contained the named value and not the ID. Now it just displays the manufacturer name by default. Then Refreshing...
  7. M

    Reading Access Database in Excel

    My apologies, I haven't explained properly maybe. I have a query of a table. Some of the table's fields are lookups to other queries including the id so that it can be referenced in vba during using the database. This is how I have always done it. I have made it so that the column containing...
  8. M

    Reading Access Database in Excel

    Hi, yes it's looking at a query, not a table. In Access, the query shows the data from the 2nd column, but when Excel reads it, it shows the data from the first 1st column. Which I don't want.
  9. M

    Reading Access Database in Excel

    Hi all, I want to link my access database to a new Excel spreadsheet so that the data is stored in Access but Excel can then read information from a table or query and then calculations can be done based on its values. At the moment, I've got it working but some of the fields have multiple...
  10. M

    query to show entries between 2 points

    Got it working! Thanks for the assistance, but did it differently in the end, used an extra field as a datepart expression in a query that controlled the form and did the arithmetic based on that instead. Thanks for your ideas though.
  11. M

    query to show entries between 2 points

    Hi there, Sadly it was giving me a syntax error on your modified code. Thanks, Simon
  12. M

    query to show entries between 2 points

    Hi all, I'm struggling with a query syntax. I'm trying to use a where clause to make only records in the last two years show up: This is invoked via VBA. My SQL is as follows: SELECT tblShowAwardEntrant.lngzShowID, tblShowAwardEntrant.lngzAwardID, tblShowAwardEntrant.lngzEntrantID...
  13. M

    Recordsets and pulling values from them

    Mstef, I think I finally understand what you were getting at. I run the query, open the form, maybe with an open argument and then run DFirst or DLast again the form and then parse the value back into the variable. Right, I shall try it tomorrow and report back.
  14. M

    Recordsets and pulling values from them

    Maybe I need to use the following code? StrBanksianWinner1 = DFirst(lngzEntrantID.column(5), tblShowEntrantAward) And then use DLast for the other variable... Would that work?
  15. M

    Recordsets and pulling values from them

    This code is called on the click of a button called 'btnCalculate'. The idea is that it runs a query to return the names of entrants who have won in the passed two years. I want to pull the value lngzEntrantID from each of the two records (first and last) and put them into 2 separate...
  16. M

    Recordsets and pulling values from them

    Hi MStef, Thanks for the reply. At what point in the code would I use the DLookup function? I've also never used it before so it is difficult to know how to implement it. What I've found so far is not hugely helpful :(
  17. M

    Recordsets and pulling values from them

    Hi all, I have some code where I run a query and then want to pull values out of it and store them in two variables: Case Is = "Banksian Medal" 'Most points in horticultuaral classes. Can only be won by same person every 3 years. Dim strBanksianWinner1 As String Dim...
  18. M

    WhereCondition linking to criteria

    That worked! Thank you. I should have tried without the double quotes before. However, since my values had dots in them, my final code for the link criteria was: strBanksianLinkCriteria = "'" & lngzEntrantID.column(5) & "' <> '" & strBanksianWinner1 & " '" & lngzEntrantID.column(5) & "' <>...
  19. M

    WhereCondition linking to criteria

    More likely i didn't explain it well. So if i remove the quotes in most places it will work? Cool i will give that a go and report back. Thanks
  20. M

    WhereCondition linking to criteria

    Hi and thanks for your response. I guess I will have to change the way i do it. lngzEntrantID is a lookup to another query with 6 different fields in. I have an idea... Can i put, say, an unbound control on the form, make it equal to column(5) and then link the where condition to that instead...
Back
Top Bottom