User Profile

Collapse

Profile Sidebar

Collapse
CarrieR
CarrieR
Last Activity: Apr 15 '11, 10:15 PM
Joined: Mar 16 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • CarrieR
    replied to Batch file doesn't run through Access
    I tried adding a lcd statement before and after the one line of my batch file - both cases, it still went to the Access default directory (C:\Documents and Settings\myname \My Documents\)

    Code:
    lcd "C:\Documents and Settings\myname\My Documents\CLIENTS - ACTIVE\"
    ftp -i -s:"C:\Documents and Settings\myname\My Documents\CLIENTS - ACTIVE\script.txt"
    Is there something else I need to do to get it to be r...
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    OK, so it's posted. I guess I don't understand the question of how I run the batch file. I literally click it, it runs. The whole thing is posted above.

    What information is missing?
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    Though for completeness' sake, the bat/cmd file I run has this:
    Code:
    ftp -i -s:"script.txt"
    script.txt has this written:
    Code:
    OPEN [ftp server name]
    [user name]
    [password]
    binary
    cd [ftp file location]
    MGET [file name]
    BYE
    (Everything secure is in brackets, of course)

    Runs perfectly each time, without fail. I'm not saying it's an Access "issue", just...
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    The cmd (or bat, either works the same) file hasn't been posted, because running alone, it posts perfectly to the correct spot. It is only if I run it with Access that it posts to the wrong place.

    Therefore, it's an Access issue. Yes?
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    The API approach, like the simple shell script, is still putting it in
    C:\Documents and Settings\myname \My Documents\
    rather than the directory I specify in the bat file.
    (and yes, it's not literally folder "myname")

    From some more investigoogling , I'm guessing it has to do with the MS Access default settings (Access Options > Popular > Default database folder). Which seems like it's just a quirk to...
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    Actually, just found what is happening, and not sure why...

    It seems like the bat is actually downloading the file to:
    C:\Documents and Settings\myname \My Documents\

    I have absolutely no idea why, unless all of the spaces in the file path is making things complicated?

    I can fix with a line moving the file, but I sure would like to understand why this is happening (only when I run it with Access this h...
    See more | Go to post

    Leave a comment:


  • CarrieR
    replied to Batch file doesn't run through Access
    No, didn't work - the issue isn't in the quotes...
    See more | Go to post

    Leave a comment:


  • CarrieR
    started a topic Batch file doesn't run through Access

    Batch file doesn't run through Access

    Hi everyone,
    I see this issue repeated in a lot of forums, but so far no answers have worked for me.

    I am trying to get Access to run a .bat file (also works as a .cmd file), using a simple Shell statement, but it isn't working - it seems to rush through it too fast. Starting the file manually outside of Access works perfectly.

    The basic code:
    Code:
    Shell "C:\Documents and Settings\myname\My Documents\CLIENTS
    ...
    See more | Go to post

  • Thanks, I appreciate the clarification, and patience! This did exactly what I needed to do.

    Just to note:
    I changed the initial set of "xlRow = xlRow + 1" (the one before the loop) to simply set "xlRow = 3", or whatever row number I need for each of these I need to write. This worked perfectly.

    Thanks again for your help!
    See more | Go to post

    Leave a comment:


  • Thanks for your help!
    Sorry this response is a little late - I had to leave and come back to this particular problem for a while...

    Problem is solved (mostly, except for one or two small issues that I can work around).

    I did want to note the issues here, for others that might see this thread, or in case anyone wanted to respond.

    To note, I followed the above code exactly. To adjust the starting...
    See more | Go to post

    Leave a comment:


  • Yes, the problem with the TransferSpreads heet command, unfortunately, is that it won't export to a specific sheet. This is a pretty vital need, since the spreadsheet is a (complex) template for a lot of reporting...
    See more | Go to post

    Leave a comment:


  • Export queries to Excel - specific sheet, specific range

    Hi,

    I thought this was a simple issue, but apparently it's not. I need to export the contents of about 30 queries, each into a specific sheet, and cell range, of an existing Excel workbook.

    Here are all of the details I need in one sample transfer:

    Query = "Query A"
    Excel workbook = "C:\Documen ts and Settings\All Users\Workbook1 .xlsx"
    Sheet = "BB DATA"
    ...
    See more | Go to post

  • Thanks, but unless there's some reason I shouldn't be doing it the way that I did, that works perfectly for what I needed.

    If there is a reason, let me know, but otherwise, it works well!
    See more | Go to post

    Leave a comment:


  • But I actually need to define it globally. (For the purposes of this DB that only I use, this is what I need.)

    I don't use any forms. This is all within modules.
    See more | Go to post

    Leave a comment:


  • I ended up solving my issue through a lot of trial and error. Here was my solution:

    I set up new module SetGlobalVariab les with the following code:

    Code:
    Option Compare Database
    
    Public gstrMonth As String
    
    Public Function SetMonthValue()
    gstrMonth = "10"
    End Function
    Then within one of the many modules that needed to call this variable, where I used to have:...
    See more | Go to post

    Leave a comment:


  • That sets it as a variable, but I need to define it, so it is defined the same way in every module that calls it (that is, setting it = "10", for example).

    So I wrote:
    Code:
    Public gstrMonth As String
            gstrMonth = "10"
    in a module SetGlobals. In one of the many modules that reference it, I simply used "gstrMonth" instead of "Month" as you said. This is exactly...
    See more | Go to post

    Leave a comment:


  • How to set up a global variable to use within various modules?

    I apologize in advance - I know this is a basic question but I absolutely can't find a way for this to work.

    Currently I have a database I've made, with several processes of importing files, modifying the results, re-exporting files, etc. These are all done as part of a nearly-automated monthly process.

    Most of these monthly processes pull from folder and file names with the numeric month in the name. So currently,...
    See more | Go to post

  • Copying 400 Files Randomly from One Folder to Another?

    Hello,
    I'm not sure if this is the right forum for this question -- I apologize if not! I am also somewhat of a novice with all of this.

    I have a folder of around 20,000 wav files, and I need to find a way to RANDOMLY extract 400 files from this folder into another, to use for analysis. Is there a way to do this within a cmd prompt, say within an xcopy command? Or is this something that perhaps can be done within an Access...
    See more | Go to post

  • Thanks everyone -- problem solved!

    Took a while to figure out the exact coding for setting Global Variables (Microsoft Access Help Files don't even seem to mention them), but it all works perfectly now.
    See more | Go to post

    Leave a comment:


  • Thank you, that certainly solved the problem of speed.

    Unfortunately, I now have a different problem. I need to set each monthly set of Visibility True/False codes separately, or I get an error that the code is too long (I can give the exact wording, if necessary). So I'm using a Select Case to call each month's coding (named SetVisible[monthname]), based on the field in the report of "Month" (Control Source and Name):...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...