Search results

  1. L

    Using variable and controls in sql strings

    Hi, could someone point me in the direction of some resource for the proper syntax of including, say, the output from a combobox into an sql string in vba? Many thanks, Lol
  2. L

    Select last record meeting conditions

    I'm just on a very steep learning curve, seemingly all the time:banghead:
  3. L

    Select last record meeting conditions

    Solved it. I was over complicating the first query , qryMaxDate and now have this: [CODESELECT Max(Tbl_Current_Location.Date_Loaned) AS MaxOfDate_Loaned, Tbl_Current_Location.ID_Product FROM Tbl_Current_Location GROUP BY Tbl_Current_Location.ID_Product; ][/CODE] I was also linking on the...
  4. L

    Select last record meeting conditions

    You're right, I've taken that out and now have: SELECT Max(Tbl_Current_Location.Date_Loaned) AS MaxOfDate_Loaned, Tbl_Product.Part_No FROM Tbl_Product INNER JOIN (Tbl_Location_Type INNER JOIN Tbl_Current_Location ON Tbl_Location_Type.ID_LocationType = Tbl_Current_Location.ID_Location_Type) ON...
  5. L

    Select last record meeting conditions

    Okay, I was approaching this from the wrong angle last time. What I need to do is check if for each item their last date of being booked had a location equal to a certain criteria. I have created a query, qryMaxDate which finds the last booking for each product. I have then linked this to...
  6. L

    Select last record meeting conditions

    Arnelgp please accept my apologies I didn't fully read your post above. The query, or Q1 as you refer to it is as below which pulls all the data I need for the report before finding the desired record and is called qryTempLocationType: SELECT Tbl_Product.Part_No, Tbl_Product.Details...
  7. L

    Select last record meeting conditions

    Hi, Arnel, sorry but your code returned every item in the table Current_Location. Pbaldy - I tried your approach with the query and subsequent query but I keep getting asked for a value for qryMaxDate.ID_Product. Here is the qryMaxDate SELECT Max (Tbl_Current_Location.Date_Loaned) AS MaxDate...
  8. L

    Select last record meeting conditions

    Thank you Arnel and PB for the solutions. I'll look at them tomorrow and see what I can make of them (i.e. understand:D) Many thanks, Lol
  9. L

    Select last record meeting conditions

    Okay, each item, be it Drill 1, Drill 2 etc will have a list of dates and locations. What I am trying to find for each item is if the most recent date and it's corresponding location match the location I enter via a combobox.
  10. L

    Select last record meeting conditions

    Hi, I have some sql below which works great in itself, but it is not for want of a better word filtering the data as I require. For example, say I have the following records below returned by the query: Drill 1| Yard | 25/3/18 Drill 2 | Van | 18/3/18 Drill 3 | Van | 17/3/18 Drill 4 | Yard |...
  11. L

    Cascading combobox query problem

    Cheers Mark, much appreciated. I struggle with the quotation marks thing sometimes. I'll give it a try. Thanks, Lol
  12. L

    Cascading combobox query problem

    Mark I think you just hit the nail on the head, I need to declare Combo as an Integer not String:o many thanks, Lol
  13. L

    Cascading combobox query problem

    Mark that's perfect thank you, but could you tell me where I was going wrong with the following code? Private Sub cboCategory_AfterUpdate() Dim SQL As String Dim Combo As String Combo = Combo & Me.cboCategory Me.cboProduct = Null SQL = "SELECT Tbl_Product.ID_Product...
  14. L

    Cascading combobox query problem

    Hi, I'm having some trouble with updating the rowsource for a combobox which cascades from the one above. It DID work but since altering relationships in the tables along the lines of what Pat recommended the combobox now no longer works. There are 2 comboboxes on frm Product, cboCategory and...
  15. L

    Combobox not binding properly

    Thanks everyone for clearing that one up for me, much appreciated.
  16. L

    Combobox not binding properly

    Can't understand this one (no surprise) but I have a combobox on a subform. The combobox has two columns in it: Column1 and Column2. During use the combobox displays column2. when I review the record again in it's subform the field values are appropriate to column2. However, when I view the...
  17. L

    Is this possible?

    I got it working. I set a query for the source of the main form, created cascading comboboxes and set the rowsource via vba and a select statement. Now let us never mention it again.
  18. L

    Is this possible?

    Okay, so I've set the recordsource for the main form to a query, qryForm_Builder as based upon Pat's suggestion. I've created two unbound cascading combo's, the first has it's rowsource set to find the product category, the second has it's rowsource set to find products based upon the category...
  19. L

    Is this possible?

    Hi, yes I found the spaces between IS and Null :o I've built a query at last and set it as the record source for the main form. I'm a little unsure as to what to do with the combo boxes though. I've attached the latest heresy for general perusal. Many thanks, Lol
  20. L

    Is this possible?

    Hi Pat, I've started building the query in access query builder and I'm having syntax problems with the IsNull function. Is there an obvious problem below: SELECT Tbl_Category.ID_Tool_Category, Tbl_Category.Category, Tbl_Product.ID_Product, Tbl_Product.ID_Tool_Category, Tbl_Product.Part_No...
Back
Top Bottom