Pass parameter into a form that use stored procedure.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that use a stored procedure as its data source. What I tried to do is to click on one button to open the form, but the parameter for the stored procedure will be the text of the button. So the form does not pop up a input box asking for the parameter.
I just can't figure out how to set the parameter. Any help will be appreciated.
 
Hi,

Try the following:

- on the first Form where you are clicking on the command button create a
textbox control (make not visible if you want to --- say it's called
"text4")

- for the command button (say it's called "Command2") on this Form have for
it's OnClick event
text4 = Command2.Caption

- on the Form that is based on the Stored Procedure for it's Input
Parameter property have

=Forms![name of the first Form]![text4]

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Thread-Topic: Pass parameter into a form that use stored procedure.
| thread-index: AcR5ic9UH6hA0VDhQZOgbd2oWDT8Eg==
| X-WBNR-Posting-Host: 38.114.17.6
| From: "=?Utf-8?B?QW15IFRleA==?=" <[email protected]>
| Subject: Pass parameter into a form that use stored procedure.
| Date: Tue, 3 Aug 2004 11:43:46 -0700
| Lines: 2
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.formscoding
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:240949
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I have a form that use a stored procedure as its data source. What I
tried to do is to click on one button to open the form, but the parameter
for the stored procedure will be the text of the button. So the form does
not pop up a input box asking for the parameter.
| I just can't figure out how to set the parameter. Any help will be
appreciated.
|
 
Thank you, Eric. I tried it, but I got another problem. I got a message saying that the secondform can't be found. Any idea on that? Appreciate your help.
Amy
 
Sorry, I mean I try to retrieve the value from the second form. And it said that the first form can't be found. Sorry for the mess up in the previous message. Thanks again.
Amy

Eric Butts said:
Hi,

Try the following:

- on the first Form where you are clicking on the command button create a
textbox control (make not visible if you want to --- say it's called
"text4")

- for the command button (say it's called "Command2") on this Form have for
it's OnClick event
text4 = Command2.Caption

- on the Form that is based on the Stored Procedure for it's Input
Parameter property have

=Forms![name of the first Form]![text4]

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Thread-Topic: Pass parameter into a form that use stored procedure.
| thread-index: AcR5ic9UH6hA0VDhQZOgbd2oWDT8Eg==
| X-WBNR-Posting-Host: 38.114.17.6
| From: "=?Utf-8?B?QW15IFRleA==?=" <[email protected]>
| Subject: Pass parameter into a form that use stored procedure.
| Date: Tue, 3 Aug 2004 11:43:46 -0700
| Lines: 2
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.formscoding
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:240949
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I have a form that use a stored procedure as its data source. What I
tried to do is to click on one button to open the form, but the parameter
for the stored procedure will be the text of the button. So the form does
not pop up a input box asking for the parameter.
| I just can't figure out how to set the parameter. Any help will be
appreciated.
|
 
Hi Amy,

I guess you are getting the error on

- on the Form that is based on the Stored Procedure for it's Input
Parameter property have

=Forms![name of the first Form]![text4]


If that is the case the form "[name of the first Form]" is NOT open. Needs
to be opened.

Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Thread-Topic: Pass parameter into a form that use stored procedure.
| thread-index: AcR7NXcduypRso+TQAKeu+lbOvNGZw==
| X-WBNR-Posting-Host: 38.114.17.6
| From: "=?Utf-8?B?QW15IFRleA==?=" <[email protected]>
| References: <[email protected]>
| Subject: RE: Pass parameter into a form that use stored procedure.
| Date: Thu, 5 Aug 2004 14:45:03 -0700
| Lines: 7
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.formscoding
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.formscoding:241272
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| Thank you, Eric. I tried it, but I got another problem. I got a message
saying that the secondform can't be found. Any idea on that? Appreciate
your help.
| Amy
|
| "Amy Tex" wrote:
|
| > I have a form that use a stored procedure as its data source. What I
tried to do is to click on one button to open the form, but the parameter
for the stored procedure will be the text of the button. So the form does
not pop up a input box asking for the parameter.
| > I just can't figure out how to set the parameter. Any help will be
appreciated.
|
 
Back
Top