Search results

  1. P

    External Name Not Defined

    Thank you for your suggestions. I did initially try to reference a grouping table similar to what you described. For some reason when I added the logic of if the pharmacy name was like *pharm_name* in the grouping table, it wasn't giving me the correct results and creating duplicate rows with...
  2. P

    External Name Not Defined

    Sorry for not giving any background, I thought it was an easy fix. I have a table of pharmacy names that I need to create a new column to group them into more simple names. The [PHARM_NAME] field is the entire pharmacy name which could be Walgreens 1, 2, 3, etc., so I am trying to create a...
  3. P

    External Name Not Defined

    I get the error that it is too complex. Any other ideas a greatly appreciated. IIf(Left([PHARM_NAME],4)="WALG" And [COUNTY]="DADE","WALGREENS SOUTH FL",IIf(Left([PHARM_NAME],4)="WALG" And [COUNTY]="BROWARD","WALGREENS SOUTH FL",IIf(Left([PHARM_NAME],4)="WALG" And [COUNTY]="PALM...
  4. P

    External Name Not Defined

    So, I removed the brackets and am no longer getting the name not defined error, but am now receiving a 'Cannot define field more than once' for the TableDef.Fields.Append fld line of code.
  5. P

    External Name Not Defined

    Hi, I am trying to create a new column within an existing table in my db. I know I need to define the external field [PHARM_NAME], but I am new to VBA and am not sure of the syntax for defining it. I was trying to accomplish this in a query expression, but there are several other criteria and...
  6. P

    Subtotal VBA Not Working

    No, this is in Access VBA. I am exporting a spreadsheet and formatting it. Do you need to see the whole code?
  7. P

    Subtotal VBA Not Working

    Hi, Does anyone know why the subtotal code below would only work with one column instead of all? It only sums the last (total) column. It's almost as if it doesn't recognize the other columns can be summed. They are all in the same format (General). Any help is appreciated! Set tbl =...
  8. P

    Need Prompt to Not Overwrite Files

    Awesome, I think that will do it! Thanks :)
  9. P

    Need Prompt to Not Overwrite Files

    Thanks, sneuberg. I believe I was able to do this, but the instance of excel that does the formatting isn't able to find the new file name since this line of code is still looking for the first filename: Set xlWB = xlApp.Workbooks.Open(Filename). Do you know how I can create two (or...
  10. P

    Need Prompt to Not Overwrite Files

    Hi, Users may want to filter on different selections and want to save several of these reports, so I am needing a way to not have my code attempt to overwrite or modify the existing file. I would need to also apply the formatting to whatever the secondary file name would be. Can someone please...
  11. P

    Error on Range("A1").SpecialCells(xlLastCell))

    I ended up getting it to work with this: With xlWB.Sheets("Summary") Set rng = .Cells(1, 1).CurrentRegion End With Set tbl = xlWS.ListObjects.Add(xlSrcRange, rng, , xlYes) tbl.TableStyle = "TableStyleMedium2" tbl.ShowTotals...
  12. P

    Error on Range("A1").SpecialCells(xlLastCell))

    Thanks! So in place of xlLastCell I put 11? (I tried that and I'm still having the same issue)
  13. P

    Error on Range("A1").SpecialCells(xlLastCell))

    I'm pretty new to this so just kinda piece mealing some code together to make it work :) If you can supply me with the correct code I would really appreciate it!!
  14. P

    Error on Range("A1").SpecialCells(xlLastCell))

    Hi, This line of code will give me a "Method 'Range' of object '_Global' failed" error about 50% of the time I try to run the below code. Debug takes me to this line: Set rng = xlWS.Range(Range("A1"), xlWS.Range("A1").SpecialCells(xlLastCell)) Can anyone help with this problem?? Thanks...
  15. P

    Applying Table Formatting in Excel Export

    So after more digging into my problem I found that I didn't have the Excel Object Library checked in References. Thanks so much for offering to help though, I'm sure I will have more questions!
  16. P

    Applying Table Formatting in Excel Export

    Thank you. I have tried using ListObject and keep getting errors. Then I tried AccessObject and that seemed to work but then it didn't like my 'Set' statement. I can post what I tried if you think you can help. Sorry, I am new to this!
  17. P

    Applying Table Formatting in Excel Export

    Hi, Is there a way to apply a certain table style in access VBA for an excel export? I've tried several things and nothing seems to be working for me. Any help is much appreciated. Here is what I have without attempting any table formatting: Private Sub SandorFormatting_Click() Dim...
  18. P

    Apply Table Formatting in Excel Export

    Thanks, MarkK. Sorry it is a Run-time error '5': Invalid procedure call or argument. Debug brings me to the .ListObjects.Add line with the error.
  19. P

    Apply Table Formatting in Excel Export

    Hi, I've been scouring the internet trying to find a way to make this work. I want to apply excel table formatting to an export from Access using VBA. Below is what I currently have. Can anyone help?? :banghead: Private Sub SandorFormatting_Click() Dim Filename As String Dim month1 As String...
  20. P

    Display Max Date Text Box

    Thanks, plog. You were right!
Top Bottom