Search results

  1. M

    Invalid argument in a query

    this looks like a good starting point and I am kinda following what's going on which is nice! Thanks a bunch good sir will let you know how this turns out tomorrow or later :)
  2. M

    Invalid argument in a query

    Hi back at my desk, putting it into a function with the calculcations I want based on the IFs i'm getting a 424 with object not defined, I have a feeling I am doing something wrong it being the first time I've made me a function - would it be possible to get 2c more from you? Thus far...
  3. M

    Invalid argument in a query

    Hey On the topic of adapting it for a query, I haven't referenced any specific controls from a form just the field names from the query that the form is based on, are there any other rules per say that should be followed when trying to get it to work in a query? I'll give the VBA bit a crack...
  4. M

    export union query to excel, delete the first row

    Ok, then I would suggest doing as Brian suggested earlier but just deleting column1 instead of row1 before the excel file is saved? xlSheet.Column(1).Delete HTH!
  5. M

    export union query to excel, delete the first row

    hm you initially said you wanted to delete a row and now you want to delete a column? You could specify which columns from the query you put into the excel sheet I believe if that's what you're after?
  6. M

    Invalid argument in a query

    Hello Multiple IFs indeed which I could explain but it's basically working out the final amount to invoice a client for, based on a few things. Sorry if i'm being really silly here but what do you mean by with a function? Do you mean to put it in a module and write it in VBA so it gets worked...
  7. M

    Invalid argument in a query

    Hi I have a db and when I put an unbound text box with a formula in it on the 'main' form as such and it calculates all as intended, but when I put this formula into a query and go to run the query it just says 'Invalid Argument'. I've done some looking around and my db isn't over 2gb and I...
  8. M

    How to export filtered table to Ms.Excel 2007

    No problem - glad to be of assistance!
  9. M

    How to export filtered table to Ms.Excel 2007

    Hi What you can do is go into excel and record a macro then save it and you'll have the code you need to set the formatting to what you want, for instance; Set wks = wbk.Worksheets(1) With wks.Rows("1:1").Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic...
  10. M

    MonthName function

    Thanks for the comments, the Format way definitely looks simpler which is good to know it does the same thing for a standard date field - will definitely use that going forward I think :)!
  11. M

    MonthName function

    Ah, figured it out EventMonth: MonthName((Month([Field Here]))) Feel free to delete thread if necessary mods sorry to waste space/time!!
  12. M

    MonthName function

    Hi A small puzzle I am hoping someone can help with, a field in my query needs to just show the month name of the date value so I have Month: MonthName([Field Here]), False] which I believe should give me a non abbreviated month name in my field. When I view my query it returns #Func! If I use...
  13. M

    How to export filtered table to Ms.Excel 2007

    The parameter hasn't been defined Here you need to close off with a & "" customQuery = "Select * from weld_performance WHERE welder_ident = " & welder needs to be customQuery = "Select * from weld_performance WHERE welder_ident = " & welder & "" Let me know how you get on
  14. M

    How to export filtered table to Ms.Excel 2007

    so how i'd do it (preference more than anything I think) Dim Welder as String Welder = Me.Combo26.Value then your customQuery "SELECT * FROM weld_performance WHERE welder_ident = " % Welder % "" But if it's pulling through the right data as it is then no worries I guess. To save as, Dim...
  15. M

    how to send attachments using path's instead of attachment field

    For this could you not use something along the lines of If Not IsNull(rsParent.Field1) Then With MailOutlook .attachments.add 'field1' 'filename' ' or whatever the actual code is EndWith end if If Not IsNull(rsparent.Field2) Then With Mailoutlook .attachments.add etc etc etc endwith end if etc...
  16. M

    How to export filtered table to Ms.Excel 2007

    Hi Here's code I have for exporting a filtered qry Dim rst As DAO.Recordset Dim customQuery As String Dim cnt As Integer Dim ID As String Dim appExcel As Excel.Application Dim wbk As Excel.Workbook Dim wks As Excel.Worksheet Dim rng As Excel.Range ID =...
  17. M

    Subform requery not working on form open

    Try; Forms![Parent Form Name]![Sub Form name].Form.Requery So in your case Forms![frmEDFP]![tblAddRefs Subform].form.requery I have it as above on a db I use regularly and this works for me, let me know how it goes HTH
  18. M

    Conditional reporting based on value of a field in a selected record

    Could you get the input from the textbox from the user, then use a DLookup to your table/query using the input ID (what the user inputs to txtbox) as a filter to get the Staff ID? Something like this (off the top of my head I may be off by an inch or a mile) Dim StDocName as String Dim RecordID...
  19. M

    Conditional reporting based on value of a field in a selected record

    If I may, how does the value of Staff_ID determine which reports to send or well how do you want it to determine which reports to send?
  20. M

    Cannot set the value of a textbox

    Hi Do you not need to Dim the MySQL and Myid? Try this Private Sub Form_Open(Cancel As Integer) Dim rst As DAO.Recordset Dim MySQL as String Dim Myid as String MySQL = " Select max(ID) from TblUserQry" Set rst = CurrentDb.OpenRecordset(MySQL) Myid = rst.Fields(0) + Int(Rnd(1) * 10)...
Back
Top Bottom