Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011

    Question Unanswered: Help me create a Public Function!


    I have the following VBA code:

    Dim dbs As DAO.Database
    Set dbs = CurrentDb
    DoCmd.SetWarnings False
    On Error Resume Next
    dbs.TableDefs.Delete "MadeTablebyQuery1"
    On Error Goto 0

    DoCmd.OpenQuery "MakeTableQuery1", , acReadOnly

    DoCmd.SetWarnings True

    I would like to create a module with a Public Function called RunMakeTableQuery() so I can use VBA to call this function and input the query name and table name instead of using this entire code every time: e.g., RunMakeTableQuery(MakeTableQuery1, MadeTablebyQuery1)


  2. #2
    Join Date
    Jul 2003
    Amsterdam, Nederland

    See here for a example

    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts