Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2005, 04:22 AM
Authorized User
 
Join Date: Mar 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to akash Send a message via MSN to akash
Default Calling VB Procedure names from AccessTable

I want to store the name of procedures in the Access table and want to call depending on the user options. Now ia am unable to call that procedure name from the table For exampl:
table is
Form name proc name
frmsl del_sl
frmpr del_pr
frmprr del_prr
   and so on
Now I want to run del_sl when frmsl is active and selected similarly del_pr when frmpr is active and so on.
Can anyone help at the earliest
Thanks


 
Old April 11th, 2005, 08:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there..

you can try with call by name... but it's very slow...

what are you trying to do?? maybe there is a better way????

HTH

Gonzalo
 
Old April 11th, 2005, 01:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

    Dim f As Form
    For Each f In Forms
        If f.Name = form_Name Then
            CallByName f, proc_Name, VbMethod
            Exit For
        End If
    Next

Marco
 
Old April 11th, 2005, 02:52 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This requires that proc_Name be part of the form referenced by f, right?
 
Old April 12th, 2005, 03:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by BrianWren
 This requires that proc_Name be part of the form referenced by f, right?
That is correct. form_name and proc_name are the strings read from the database, and proc_name must be a method exposed by the form named form_name. The code I posted must be enclosed, as always, in an error handler, because CallByName cannot be resolved at design time (it is in fact a late bound call)
Marco





Similar Threads
Thread Thread Starter Forum Replies Last Post
calling stored procedure jomet JSP Basics 0 November 23rd, 2007 08:06 AM
Calling Stored procedure in VB.NET kganti VB.NET 2002/2003 Basics 0 March 26th, 2006 08:30 PM
VB calling DB2 stored procedure sangsri VB How-To 1 July 13th, 2005 08:55 AM
Stored Procedure names are different gokeri SQL Server 2000 0 April 2nd, 2005 05:54 AM
Procedure Calling Syntax Needed SerranoG Access VBA 4 October 24th, 2003 07:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.