Search results

  1. D

    VBA SQL Help

    pBaldy - you speak in riddles. I'm trying to understand, but why would execute not be the correct use? I am performing an inner join. Wouldn't that be an executable command? I tried using the help function and got: CurrentDb.OpenRecordset StrSQL, dbOpenSnapshot It didn't work. I got an...
  2. D

    VBA SQL Help

    Bump. Still need the magic coding. Anyone?
  3. D

    VBA code from Excel not working in Access

    Very cool. Here is a solution to the problem. I am assuming that the "-" is in the same place everytime. In this example i have the dates formatted as "xx-xxxx" or "10-2012". Function changeDate() Dim xSpot As Integer Dim myDate, newMyDate, firstPart, secondPart As String xSpot = 1 myDate =...
  4. D

    VBA code from Excel not working in Access

    Lol at how this forum dies as soon as the work day ends and especially on weekends. That's some nice coding. I probably won't be much help to you but I'll try. From what I've noticed with my recent experimentation with access is that most of the key words from xcel don't really translate to...
  5. D

    VBA SQL Help

    Pat Hartman - I tried using CurrentDb.OpenRecordset strSQL, dbFailOnError instead but got the error message Invalid Argument. Also the reason that I'm doing it this way is that a) I'm better this... which says something about my skill b) I am trying to do some complex activities with one click...
  6. D

    VBA SQL Help

    Here is the updated code: strSQL = "SELECT Principal.Cusip, Interest.[Payable Date], Interest.Interest, " & _ "Principal.Principal, Interest.Interest+Principal.Principal AS Total INTO [DTC Amounts Paid] " & _ "FROM Interest INNER JOIN Principal ON Interest.Cusip = Principal.Cusip " & _ "WHERE...
  7. D

    VBA SQL Help

    Ok. I have it updated a bit. The error from the VB compiler is that "DTC Amounts Paid" already exists. It apperantly doesn't like that I already have this table already in existence. I just want to update the same table everytime, not create a new one every time. Do you know what I need? I will...
  8. D

    VBA SQL Help

    Good to know. Learning new stuff everyday. The basic layout of most of the VB that I code comes from previously written programs which I don't have a full understanding of. I have removed that code and have included the debug.print strSQL. The error that comes up is "Cannot execute a selected...
  9. D

    VBA SQL Help

    Thanks spike. The problem I'm having is that it doesn't work. It reads the sql, then it goes to the currentdb.execute and errors out. My fail message consist of a msgbox that says "Error". I will look over the link you sent me and see if I can figure it out through that. I was thinking that...
  10. D

    VBA SQL Help

    I have this little ditty that I would reallly like to work. I'm actually copying this from an existing database and trying to get it to work for mine. So far I have had absolutely no luck. The other db used a query, I am using VB. I don't know what I am doing wrong. All the objects are valid. Do...
  11. D

    Sql --> vba

    AccessMSSQL - Thank you. You're right it was working. I actually had some other previous code dumping info in there first lol. I'm learning slowly. Thanks for that left clarification also cause I was trying to work with that before the like 0*.
  12. D

    Sql --> vba

    The cusip is formatted for Text as it can contain letters and numbers. I only want those that begin with 0. It's tough to get it in the right format but an example of a cusip is: 094147BS3 or 94985PAE6 or 55265K7M5. Is that enough? Account is text also, Reg is number, date is date, amount is...
  13. D

    Sql --> vba

    AccessMSSQL - Thanks! That's what I'm looking for! Only problem is that I can't quite get it to work. I think I've narrowed the problem down to the like statement. I've tried it with different sets of quotes around the 0* but it still grabs everything and dumps it into suspenseTemp. Any ideas...
  14. D

    Sql --> vba

    I'm trying to turn an access query into VBA code and was wondering if I could get some pointers on what I'm doing wrong like things I should change and things I shouldn't. The query: SELECT Suspense.CUSIP, Suspense.Account, Suspense.[Registration Code], Suspense.[Payable Date]...
  15. D

    Text file input code

    What if I just ask if anyone can tell me what this means: New ADODB.Recordset? And how I can get it to work
  16. D

    Text file input code

    Alright so I'm at the next stage in my noob database/thing. I want to import a text file and I came across this after a couple searches: Set cncurrent = CurrentProject.Connection Set rsDiag = New ADODB.Recordset ' Open the text file Open "F:\Documents and...
  17. D

    Filter Macro

    pbaldy - Thank you very much! Mission accomplished.
  18. D

    Filter Macro

    errr.... can you tell me how to do that :) I have the table, but I don't know how to make them display on the form...
  19. D

    VBA Excel Range problem

    Just use a variation of what I told you. I don't feel like writing out a whole program for it, but you just have to tell it to stop doing something when the ID# changes. totalTotal = 0 So have it add up individual cells and then do a = total, do totalTotal = totaltotal + total And Loop until...
  20. D

    VBA Excel Range problem

    THE IMPORTANT STUFF IS AT THE BOTTOM -- The rest is just an instructional course to get there -- I think your problem is that you are using ranges for individual cells. You might have better luck if you used cell instead of range... Sheet1.cells(x,y).value = sheet1.cells(x,y) +...
Back
Top Bottom