Search results

  1. S

    Query to SQL linked table not returning values

    Hi, I have a couple of linked tables from SQL (I prefer to use the built in Access query builder to build queries) in Access O365. If I create a query using the like parameter with a wildcard I don't get any values back but if I just query the actual value I do. I could give an example but...
  2. S

    SQL Select statement help please

    Hi guys, I cant get my head around what appears to be a simple sql select statement and was wondering if someone can help me please? I have 2 tables table 1 has all the data Im after but is linked to table 2 by a Request_ID Field. They say a picture paints a thousand words so...
  3. S

    Can anyone see whats wrong with my code please?

    Hi, Trying to export values from an Access table no matter how I format the date it doesn't export properly (the export works but the date specified is ignored) strFile = "C:\" & Format(Date, "ddmmyyyy") & ".csv" strDateEntry1 = Format(InputBox("Please Enter From Date...
  4. S

    Automatically linking an ODBC connection

    Hi, Im looking to automate the process of linking my Access DB with an ODBC connection to an SQL DB with VBA (unless theres an easier way to do it?) - can anyone either point me in the right direction of some sample code - that's if this is possible at all? Thanks
  5. S

    Syntax Error in INSERT INTO - but I just cant see what it is?

    Hi, I cant seem to get my insert statement to work, Ive checked (although I could be wrong) for reserved words and I don't seem to have any. Ive declared what the fields are so that should be ok, it just wont insert: Dim sEmployeeName As String Dim sLogonAccount As String Dim sDepartment As...
  6. S

    Creating a list based on multiple queries

    Hi, I have 3 select queries which Im trying to output to a combo - Ive tried a UNION query but I get an error ODBC-- call failed ODBC Driver SQLBase..... Firstly is do the results need to match within a union query? I mean they have no relationship what so ever Im just trying to populate...
  7. S

    Importing users from AD into a table

    Hi, This code was copied from another location (not this forum) and before I just copied and pasted it I wanted to understand what exactly it was doing and how to trigger it correctly. Private Sub Form_load() Public Sub TestCode(strDomain As String, strGroup As String) Dim objGroup As...
  8. S

    Displaying the results of a formula

    Hi, Im trying to work out how I show only fields which have text in them. For this I have a formula which works out if that field is true or false (contains text or not) and now Im trying to display the ones which show text only. I've managed to do this within the supress format but because...
  9. S

    How to output my VBA SQL query to a report

    Hi, Ive had a complete blank... Im trying to output my VBA code to a report but I cant for the life of me think how to do it. Here is my code: Dim strEmployeeName As String strEmployeeName = EnUsername DoCmd.RunSQL "SELECT StrConv(Replace([sUser],""."","" ""),3) AS Employee...
  10. S

    New'ish to SQL queries and having problems with a Select query

    Hi Guys, recently and for no apparent reason I am starting to look at SQL queries and understand how they work (this is coming from writing VBA queries and using Access A LOT). Im creating a very basic SQL query as you can see and I can browse to the table which I am getting the error about...
  11. S

    Is it possible to create a union query within Crystal reports?

    Hi, I currently have 2 separate crystal reports which I would like to join as one. Can I create a Union query within crystal as I can within Access or is there a better method to achieve joining the two? Thanks
  12. S

    Combining two queries without a union query

    Hi guys, Im trying to join two queries as I am unable to use just a single query but I cant use a union query as the query fields aren't exactly the same. Both queries have a PO_Detail field as every PO has a PO_Detail number assigned to it. 3 of the same records are in both query...
  13. 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...
  14. 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]...
  15. 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
  16. 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...
  17. S

    Exporting to Excel - One listbox per sheet

    Hi, Im looking to export my listbox values to a single workbook BUT a new sheet is created per export. There are 6 listboxes in total and I already have the code to export a single listbox but if I try to use this code its going to overwrite the csv each time - I was wondering if anyone could...
  18. S

    Checking multiple subform for values before closing

    Hi Im looking to check 3 sub forms for values and if they contain any then delete them. After a bit of googling I discovered that you should use recordset.recordcount - to which I tried but I get method or data not found - is this a valid method? My code to which Im using is: If...
  19. S

    Type Mismatch on VBA SQL - I think its the date?

    Hi guys, yep me again... How do you show dates within SQL VBA? As Ive been struggling with the below code and cant for the life of me get it to work. Im sure its the date that's incorrect and Ive tried putting #'s in but still it errors with type mismatch. Could someone enlighten me please...
  20. S

    Output query results - which is the preferred method?

    Hi, Im trying to output my query results and am a little hesitant as to which method is the best. Would you output the results to a subform or a listbox? I mean there must be a reason as to which method is the preferred method and I cant seem to find out what it is? Thanks :banghead:
Top Bottom