Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA Codes + Passing a parameter

(0) ShareShare
ReportReport
Posted on by

Dear All,

I would like to feed my stored procedure with a parameter (voucher number) from VBA window through a combo box. This parameter is required severally through my stored procedure during execution.

I have already selected all voucher numbers I need on a combo box. Now I need to a solution whereby if select a voucher number from my combo list and click a button, the voucher selected will be passed to stored procedure as stored procedure culminates its execution.

Any suggestions. I will be very grateful.

RomRyan

*This post is locked for comments

  • Romryan Profile Picture
    Romryan on at
    RE: VBA Codes + Passing a parameter

    Thanks Mick, this really helped. You nailed it.

  • Verified answer
    Mick Egan Profile Picture
    Mick Egan 3,561 on at
    RE: VBA Codes + Passing a parameter

    Assume you can setup VBA with the connections, but would look something like:

    Dim StrVoucher as String

    StrVoucher = Trim(Me.Voucher)

    cmd.CommandText = "exec VoucherStoredProcedure '" & StrVoucher & "' "

                  cmd.Execute

    Mick

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans