Results 1 to 7 of 7
  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    Message Box

    Hello ,
    I have a Access progarmm with has 7 large marcos in it that run different queries , output files.Before running macro, I pul Excel srpreadsheet into a specially desing directory and then i click on macro .I would like to set up on each macro message warning as a remainder to new user such as "Please don't forget to put the Excel spreadsheet into that directory" so that new user when he clicks on macro this messgae pop up and he would be able to cancel the macro if the Excel spreadsheet has not been uploaded in there .
    Trying have to do this , but so far got no succes .

    Very Appreciate help .



    Best Regards

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I'm assuming you have a form where you are clicking the button. You can use Len(Dir("Full file path")). Your code would look something like this:

    Code:
    If Len(Dir("C:\Data\ExcelFile.xls")) = 0 then
         MsgBox "Excel file does not exist, please copy Excel file to proper location.", vbOkOnly, "Missing Excel File"
         Exit Sub
    End If
    Put this code at the beginning of your code block in the "Click" event of your button.

  3. #3
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thank you ,

    But there is not a form , just the macro in marco in macro object of database. Of course I would like to integrete this code into macro -but how I can do it ?

    Thank very much

  4. #4
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I'm not sure how you would integrate the code into a Macro, especially in MS 2003...I know in 2010 you can convert macros to VBA by clicking "Convert Macros to Visual Basic". You can then run VBA code by calling the specific Macros (after conversion they will be functions).

  5. #5
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thank you Jgelpi .Accutally That works fine .I created new form with command button on it and paste the code into command button and run and it worked prefectly .The user when he click on macro the form openes up and the user clicks on command button to contiunue .That worked .

    Thank you very much

  6. #6
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Great, glad it worked. Please don't forget to mark thread solved.

  7. #7
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    dUE respect - i don't see any mark "solve" to mark .How I cam mark this tread solved ?
    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Message Box
    By dunnmel4 in forum Programming
    Replies: 9
    Last Post: 04-12-2011, 10:44 PM
  2. Error Message
    By Juan4412 in forum Forms
    Replies: 5
    Last Post: 03-06-2011, 04:22 PM
  3. Message Box question
    By bullwinkle55423 in forum Programming
    Replies: 1
    Last Post: 08-12-2010, 09:01 AM
  4. SendObject Message
    By williammarino in forum Forms
    Replies: 4
    Last Post: 10-06-2009, 01:54 AM
  5. message box help
    By shaz10010 in forum Forms
    Replies: 1
    Last Post: 04-17-2009, 09:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums