If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Help me create a Public Function!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-06-11, 20:39
MFleysher MFleysher is offline
Registered User
 
Join Date: Apr 2011
Posts: 11
Question Help me create a Public Function!

Hello!

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)

PLEASE HELP!!!
Reply With Quote
  #2 (permalink)  
Old 08-05-11, 08:52
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On