Search results

  1. A

    Formatting Data on Export

    errrrmmm.... yes? no? I really don't know. What do you mean by data type? I have never tried to use access to control other applications so am somewhat out of my depth on this one! It seems to work when opening a predefined file so where I am looking? The GetObject part or the part I am trying...
  2. A

    Formatting Data on Export

    Hi All, I have set up a code that will export information from a query based on conditions described by functions within the code and I am now trying to take hold of Excel (the information is exported to there)and format the data. I have seen a coulpe of ideas kicking about on the net but...
  3. A

    Change Query Field Names on Export

    So I figured it out and there is nothing more annoying when I've been searching for this than to find my exact issue only to realise that there has been no response to the previous person asking, so here it is: replace that part I said was supposed to work with this: 'Sets the field names...
  4. A

    Change Query Field Names on Export

    Hi All, I have some vba code that creates a temporary query and exports this to Excel. This issue that I now have is that there is now a requirement to make each of the field names / labels etc variable and listed in a master table (tblFieldNames). This is working fine for everything I'm doing...
  5. A

    Build Query from Multiple ListBoxes

    I missed this one in the declarations! (changes the dates for the Jet engine) Const conJetDate = "\#mm\/dd\/yyyy\#"
  6. A

    Build Query from Multiple ListBoxes

    Ahhh... the trying it with only fixed it for me - the first list it was searching was a number and the rest text - I don't really need to use that one so I've removed it completely and it works a charm now - thanks for you help :) If you were interested I ended up with this: (I can't remember...
  7. A

    Build Query from Multiple ListBoxes

    Hmmm... Thought I had it but something is still not right! varWhere = varWhere & ctrl.Name & " = " & ctrl.ItemData(varItem) & " Or " - gives me a syntax error (missing operator) varWhere = varWhere & ctrl.Name & " = """ & ctrl.ItemData(varItem) & """ Or " - works without an error but doesnt...
  8. A

    Build Query from Multiple ListBoxes

    Thanks Smig, I knew that would be the case but I was missing another & before the = (and got rid of the "" at the end) - that's why I was getting the other errors. I've ended up with this and it works fine - just need to fit it into the rest of the code now :) Dim varWhere As Variant Dim...
  9. A

    Build Query from Multiple ListBoxes

    Hmmm... you said my post was ambiguous?! I kind of guessed myself that was where my issue is (as I mentioned in my last comment), however I don't know how to fix it. When I move around the quotations I either get "ctrl.name", false, or Error: Type MisMatch. I don't know how to pass the actual...
  10. A

    Build Query from Multiple ListBoxes

    Apologies, I should have made this clearer (I've been getting a bit frustrated but yeah... not a very helpful description! Sorry!) The first code is the one that I am trying to adapt... I don't need the combo and date sections of it at the moment but may do in the future so I have left these...
  11. A

    Build Query from Multiple ListBoxes

    Hi all, I've seen a number of threads about this but most are pretty old and don't really address what I'm looking for. I have the code below which generates a string that I pass as SQL to create a query to bring the information into a subform. This works perfectly well, however I am now...
  12. A

    Dynamically creating table using form

    Hey Niros, I just did a similar thing but with exporting the data... are you creating the query from VB? Does the user select from predefined fields? I have some codes in my post 'Create Query from Where as recordsource' (I can't link the thread as I don't have enough posts but if you click...
  13. A

    Create Query from WHERE with VB as Recordsource

    ... and if anyone needs them these are the functions for the strings... Private Function BuildRept() Dim varFiltr As Variant varFiltr = Null For Each ctrl In Me.SearchSubForm.Controls If ctrl.ControlType = acTextBox Then If ctrl.ColumnHidden = False Then varFiltr = varFiltr &...
  14. A

    Create Query from WHERE with VB as Recordsource

    It's cool... just answered my own question! All I needed was a dim as string! Private Sub ExportBtn_Click() On Error GoTo errHandler Dim qdf As QueryDef Dim rept As String rept = BuildRept & " FROM " & "AllQuery" & BuildFilter DoCmd.DeleteObject acQuery, "qryTemp" Set qdf =...
  15. A

    Create Query from WHERE with VB as Recordsource

    Hi All, I am trying to create a new query through VBA that will take the SQL as a string for the fields and values required. This will create a query that will then be exported to excel. This is a combination of a few codes that work fine themselves, however I don't seem to be able to figure...
  16. A

    Show All Columns on Subform on Open

    Works a charm, Bob, Thanks!!
  17. A

    Show All Columns on Subform on Open

    Thanks both of you... Severin, I did think about that, however the form will need to reset each time it is loaded and is from a dynamic datasource so can't get my head around how to make that work in practice! PeterF I think that is what I am looking for, however (forgive me if I'm being...
  18. A

    Show All Columns on Subform on Open

    I have a from with subform where the columns that are visable in the subform are controlled by checkboxes on the parent form. I am trying to find a way to ensure that ALL the columns are visible when the form is opened, however I am running into a couple of issues: DoCmd.RunCommand...
  19. A

    Dynamic Filter Only Showing One Record

    In case anyone else was browsing this and looking for a resolution, I found that I had Dim select1 as String Dim select2 as String ... changing this to Variant has worked a charm!
  20. A

    Dynamic Filter Only Showing One Record

    Thanks Beetle, I tried with both but neither is helping. I have a feeling that it may be to do with the relationships between the tables as this was working when it was looking up a seperate query for each return and it isn't now. I might try a SELECT DISTINCT ROW instead (though I never like...
Back
Top Bottom