Search results

  1. L

    QBE Grid Query: Search for specific date

    Hi all, Currently, I have a query which is set-up for searching on multiple fields on a form. I am having an issue with finding a specific date within a month. For example, the query field is as follows:- Field: myDate: Day([ID_Date]) Criteria: Like "*" & [Forms]![frm_DataMart]![cmbDate] &...
  2. L

    Comma-delimted text values to ListBox

    Hi all, I have the following code on the "on-click" event of a listbox which populates a textbox:- Dim strSelected As String Dim varItem As Variant With Me.lstClientCodes For Each varItem In .ItemsSelected strSelected = strSelected & "," & .ItemData(varItem) Next varItem...
  3. L

    Distributing Front-End

    Morning all. Can someone please point me in the right direction or advise. I have a split DB and multiple FE's for approx 15 users. When I update the FE, I do a quick copy/paste replace and rename the files accordingly. This doesn't take long, but I was wondering if there was a more...
  4. L

    DoCmd.Output

    Hi all. I am currently using the following line to output data to Excel:- DoCmd.OutputTo acOutputQuery, "qry_OutstandingRecs", acFormatXLSX This will open a dialog box and you select a path/directory for saving. Is there a way that you can capture the name of the file/path in a variable then...
  5. L

    Collections and Bubble Sort (maybe)

    Hi all. I have found the following piece of code which finds dupes in a comma delimited string and removes them. This works faultlesly:- Dim sString As String Dim MyAr As Variant Dim Col As New Collection Dim itm, i sString = Me.txt_CodeString MyAr = Split(sString, ",") For i = LBound(MyAr)...
  6. L

    Enhancing ADO import query

    Morning all, I have the following snippet of code which connects to our sqlServer via ADO:- Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim sConnString As String sConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security " & _...
  7. L

    TransferSpreadsheet to Desktop problem

    Hi there, I have a bunch of code which transfers data to an Excel file via queries. When I select, say, 'C' drive (any drive/folder) the code executes without problems and I can run this over-and-over again. However, if I try and save to desktop (redirection), it may work the first time but...
  8. L

    DateAdd advice please

    Hi all, I have a start date of, say, 31st October and I want to add forthcoming monthly dates to a table for the 31st of each month. My inital sequence is: StartDate = #31/10/2015# Do IncrementDate = DateAdd("m", 1, StartDate) '''stuff Loop What happens is that the next date is the 30th...
  9. L

    Recordset null value

    Hi all, Before saving a record, I am testing 12 form fields for duplicates against all records in a table. However, I have an issue whereby if the table field is null and the text field on the form is null, it doesn't recognise this as being equal. This is the line in question:-...
  10. L

    Referencing text-box name

    Hi all, Hopefully, I can make myself understood on this one. Seems simple enough, but I just cannot work it out. I have one line of code which reads:- myControlName = [FORMS]![FORM1]![txt_myControlName] Text field txt_myControlName stores the name value of another text box on that form (this...
  11. L

    INSERT INTO query: Data chopped off at 255 char

    Hi all, I'm using an INSERT INTO query (in a standard VBA module) and one of the fields in the underlying table is set to MEMO. Query runs okay, but only the first 255 characters are inserted. When I Debug.Print to the Immediate Window, all 423 characters are displayed correctly. Please...
  12. L

    Data Import from Excel (memo field truncated)

    Hi, There is a resolution to this already, but was wondering if there is an alternative method. I have several records in an Excel file which can contain fields of over 255 characters. Therefore, I set up the Access table field as "memo-type". Before importing, I need to create 10 or so...
  13. L

    DateAdd function

    Hi All, I've been using the DateAdd function to great effect, but am stumped on a solution for this problem. I have a table full of dates which run in sequence, i.e. 1/9/15, 2/9/15, 3/9/15 and so on. I require a query to show me dates for just every two weeks starting from the 1/9/15, i.e...
  14. L

    Update Query

    Good afternoon, I have a saved update query (created from the QBE editor) which takes the values from unbound text fields on a form and updates an underlying table. However, if a text field is left blank, it overwrites any existing data in the table for that particular field with blank data -...
  15. L

    Labels not repainting

    Hi there, I have the following piece of code on a command button on a form: The label is not visible when I execute the code via command button. However, if I step through the code, the label works like a charm. I've added Me.Repaint, DoEvents etc, but to no avail. Could it be that the code...
  16. L

    Replicate Excel Table

    Hi, I have a table in Excel with number of prints along the top and postcodes down the side (see example, below):- Prints..1....2.....3.....4....5 AA....£1...£2...£3...£4...£5 AB....£2...£3...£4...£5...£6 I use VLOOKUP and MATCH forumlas to return the results. How would I achieve something...
  17. L

    General Date/Time convert to Short date

    Hi all, A csv file I am working with has the following example dates: 2/22/2012 12:00 AM using DateValue converts it to 22/02/2012 (dd/mm/yy) which is correct 3/7/2012 12:00 AM using DateValue converts it to 03/07/2012, but it should read 7/3/2012. It seems like some sort of date conversion...
  18. L

    Image SpecialEffect

    Hi all, I have the following code in the OnLoad event of a form: Dim ctrl As Control For Each ctrl In Me.Form If ctrl.Tag = "cmdSpecialEffect" Then ctrl.SpecialEffect = 1 End If Next ctrl There are several buttons on this form. I could place a MouseUp/MouseDown event behind each one so that...
  19. L

    Access 2007 and pass-through query to SQL Server

    Hi there, I've, today, created my first pass-through query (wahooooo!) which links my Access 2007 db to a query in SQL Server. Is there a way that I can refresh the SQL Server query from Access? For example, when I "refreshall" from Access, the pass-through always remains at the same number...
  20. L

    Filtering specific data

    Hi there, I've been trying to work this out for ages, but can't get my head around it. Example data: A = 1 A = 2 B = 1 C = 1 C = 2 C = 3 D = 2 E = 1 E = 3 I want a query to filter-out any letters that have a value of 1 or 2, but not 3. Therefore, the result for the above data would be: A...
Top Bottom