Search results

  1. S

    Deleting values from a table which are selected from a list box

    Hi Guys, Im trying to delete values from a table based on the selected values of a listbox. The listbox values have a hidden column which related to the ID on the table to which I am trying to delete from (if that makes sense). If I use the following code: Set ctl = Me.Results_listbox...
  2. S

    Can someone help me with my sql in VBA please?

    Fair enough - it was me just being lazy. Ive put some logic into my code and created 2 sql queries depending on the selection :)
  3. S

    Can someone help me with my sql in VBA please?

    Hi Guys, I got this working in the end using the form values rather than converting the form values into vba code. What I'm now trying to do is use a wild card within an if statement. So if tick box is true then use the form value else use a wild card search (which should return all values)...
  4. S

    Can someone help me with my sql in VBA please?

    I tried the suggestion in #4 and I still get an empty listbox. I have been using the debugging tools (well as well as I know how to use them) and I cant for the life of me see why the list box isn't showing the results. If I use the immediate window to show the form values they are correct...
  5. S

    Can someone help me with my sql in VBA please?

    Im actually glad to know its not just me who doesn't get on with dates in VBA :) So although the dates appear to be doubles, the fact that dates are stored like this anyway Access sees them correctly? Im about to give up on this, Im sure its something really trivial but my query seems correct...
  6. S

    Can someone help me with my sql in VBA please?

    Thanks, I understand. TO elaborate on CDbl are you setting it to this as per frDate = CDbl(Me.TotalHours_Fromtxtbox) toDate = CDbl(Me.TotalHours_Totxtbox) As if there's an easier way to handle dates Im always up for learning :)
  7. S

    Can someone help me with my sql in VBA please?

    Ok, but... And theres always a but :) Am I correct in thinking if whilst debugging and I hover over the date variable in the sql and it shows correctly then the criteria is in fact correct? For example frDate on the form was 27/01/2013 and this was also the case when debugging.
  8. S

    Can someone help me with my sql in VBA please?

    Thanks - will give it a go. Before I do, I used this method to set the dates frDate = CDate(Me.TotalHours_Fromtxtbox) toDate = CDate(Me.TotalHours_Totxtbox) Is this not the correct way to do it? Thanks again
  9. S

    Can someone help me with my sql in VBA please?

    Do you mean like this? strSQL = "SELECT TimesheetTable.sUser, TimesheetTable.Activity, TimesheetTable.Hours, TimesheetTable.Project, TimesheetTable.[Task Date], TimesheetTable.Description " & vbCrLf & _ "FROM TimesheetTable " & vbCrLf & _ "WHERE (((TimesheetTable.sUser)=""" &...
  10. S

    Can someone help me with my sql in VBA please?

    Hi, Ive added breaks and the variables are returning their values fine when I hover over them, but can I see where the syntax error is - can I..... strSQL = "SELECT TimesheetTable.sUser, TimesheetTable.Activity, TimesheetTable.Hours, TimesheetTable.Project, TimesheetTable.[Task Date]...
  11. S

    Adding a value to a query

    Again apologies - what I was originally trying to do was use a combo box to lookup employee names from a table. But what I was also trying to do was add the word all employees to the list of the combo box so the user could either select a single employee from the combo or all employees. But...
  12. S

    Adding a value to a query

    Sorry, yes I understand what your saying. I have changed the way my form works and instead of being lazy I have added a select box and some logic to my sql statement which either looks for the control box or selects from the combo box. Thanks - and sorry for the random question :)
  13. S

    Adding a value to a query

    Ok so, Ive got a lookup query which displays all users. What I would like to do is to append either the word None or a - to the query results. I appreciate there are probably other ways or better ways of doing this but I was just curious as to if it was possible. Thanks
  14. S

    Adding a value to a query

    Hi, Am I being stupid or is it possible? I have a query which looks up records from a table, now what I would like to do is append the word All Projects to this query - is it possible, and if so how? Thanks
  15. S

    Return Description value realting to PO table value

    Ah ok thanks, that's what I thought you meant but I can never be too sure :) Surprisingly with a little bit of adjustment I think it should be ok :)
  16. S

    Return Description value realting to PO table value

    Thanks for the Nz tip - worked a treat. Although it is a false errand as I need to get this into crystal reports, but it's helped. Also when you say about SQL <> SQL Im not too sure what you mean? You can create SQL queries within Crystl Reports - are you referring to the fact the SQL context...
  17. S

    Return Description value realting to PO table value

    Thanks, it would seem that some of the descriptions are stored within the Material_Req.Description and some are stored within the Source.Description. I've managed to create a query which picks up the description from the Source.Description and also queries a separate query which holds any...
  18. S

    Return Description value realting to PO table value

    Ive added a sample of the database changing any confidential info. What I am trying to get is the PO numbers 3864,3872,3882,3886,3892 and 3893 to show their descriptions from the material_req table. Just to note Im not asking you to do it, but if you could explain based on these tables how I...
  19. S

    Return Description value realting to PO table value

    Hi, This one is really puzzling me and I cant see why I cant get the values to match. I have 3 tables joined as attached and Im trying to use the PO from the PO_Detail table to display the Description from the Material_Req Table. The two values are linked as the description in the Material_Req...
  20. S

    Exporting to Excel - One listbox per sheet

    Converted it to a query instead (just in case the listbox was going to cause an issue). If I try to execute this I get type mismatch on the qdf.name - any ideas? Dim strSQL As String Dim qdf As DAO.QueryDef strSQL = "SELECT NoneChargeable_Admin.EmployeeName, Sum(([TotalHours])) AS [Combined...
Back
Top Bottom