Results 1 to 5 of 5
  1. #1
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245

    open a table from msg box

    hey, i currently have this as my code aafter i successfully import the data:



    Code:
    MsgBox "Successfully Imported",
    How can i set it up to have a button which opens a table. the table is selected from the combo box (cbotblname) thanks in advance.

    I know you should open tables, but i want to because these are feeder tables into append queries, so i have to veiw them before. thanks,

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    To get the VBA code to open a table, you can create a Macro that does one (using the "OpenTable" command).
    Fill out the appropriate arguments (there are descriptions, and you can press F1 for more help).
    You can then save this Macro and convert it to Visual Basic code by clicking on the "Convert Macros to Visual Basic" button on the Visual Basic menu/ribbon.
    This will show you the code you need, and you can replace any of the arguments with variables (i.e. to make the table name dynamic based on a value in your combo box).

  3. #3
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    I know how to open a table from vba, what my question is using the msg box command can you add a button to it which opens a table? thanks

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I don't think you can add a button to your message box, but you can tell it what to do depending on what they click (yes/no/cancel).
    If you want to customize something with special buttons, you will probably need to create your own Form.

  5. #5
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    ok thanks for letting me know!!!

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

Similar Threads

  1. Open Link Table list with VBA?
    By AccessMasterFromTheStart in forum Import/Export Data
    Replies: 0
    Last Post: 02-26-2012, 04:12 PM
  2. Frmlogon to open table for that user only
    By b_best in forum Access
    Replies: 13
    Last Post: 01-30-2012, 03:17 PM
  3. Replies: 4
    Last Post: 10-05-2011, 01:28 PM
  4. open file as per field in the table
    By yoyo46 in forum Access
    Replies: 1
    Last Post: 06-16-2011, 12:28 PM
  5. Open a table in a From based on a filter
    By turbobeagle in forum Forms
    Replies: 1
    Last Post: 01-11-2008, 12:27 PM

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