Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

error in runtime: bad query parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
korsakow - 13 Jan 2008 01:46 GMT
Just getting into access 2007 runtimes and am having a problem with opening
forms when passing parameters from one form to another.  We have a main menu
and the user selects a facility then if they click on another button, it
opens another form which the data source for that form is an sql 2005 stored
procedures and the parameter being passed to it is a field off the main menu.
This worked fine in 2000 runtime and it works fine if you have full version
on access 2007 installed but not in runtime.  We get an error "Bad query
parameter '@Facility'.
Thanks,
Tom van Stiphout - 13 Jan 2008 02:33 GMT
From your reference to SQL 2005 I take it you are using ADP?  If so,
take a look at the issues I posted a while back:
http://groups.google.com/groups?as_q=%22adp+in+a2007+runtime%22

Unfortunately they remain unfixed. It very much looks like MSFT has
given up on ADP, at least in the runtime environment.

-Tom.

>Just getting into access 2007 runtimes and am having a problem with opening
>forms when passing parameters from one form to another.  We have a main menu
[quoted text clipped - 5 lines]
>parameter '@Facility'.
>Thanks,
korsakow - 13 Jan 2008 03:33 GMT
how have I to make the workaround with: dbo.PRO_GEBRUIKER  and the parameter:
@txt=[forms]![FRM_GEBRUIKER]![txtGetUserName]?
Is this correct?: - "exec dbo.PRO_GEBRUIKER
@txt=[forms]![FRM_GEBRUIKER]![txtGetUserName]" -

thanks a lot!

> From your reference to SQL 2005 I take it you are using ADP?  If so,
> take a look at the issues I posted a while back:
[quoted text clipped - 14 lines]
> >parameter '@Facility'.
> >Thanks,
Tom van Stiphout - 13 Jan 2008 20:46 GMT
No. The statement is passed to the server, which knows nothing about
Forms!...
Rather write something like:
="exec dbo.PRO_GEBRUIKER @txt='" &
[forms]![FRM_GEBRUIKER]![txtGetUserName & "'"
Note the single-quotes around the text argument.

-Tom.

>how have I to make the workaround with: dbo.PRO_GEBRUIKER  and the parameter:
>@txt=[forms]![FRM_GEBRUIKER]![txtGetUserName]?
[quoted text clipped - 21 lines]
>> >parameter '@Facility'.
>> >Thanks,
korsakow - 14 Jan 2008 00:32 GMT
so, I typ in the RecordSource property everything between -   - ?
- ="exec dbo.PRO_GEBRUIKER @txt='" &
[forms]![FRM_GEBRUIKER]![txtGetUserName] & "'" -
if I do this, I get the follow error in dutch: Kan voor de tekenreeks vanaf
positie 43 in de opdracht geen afsluitend scheidingsteken vinden. De
tekenreeks begint met: "PRO_GEBRUIKER txt='''''.
in english: can't find closing separation sign for the string as from
position 43 in the task. The string begins with: "PRO_GEBRUIKER txt='''''.

> No. The statement is passed to the server, which knows nothing about
> Forms!...
[quoted text clipped - 30 lines]
> >> >parameter '@Facility'.
> >> >Thanks,
Tom van Stiphout - 14 Jan 2008 02:23 GMT
>so, I typ in the RecordSource property everything between -   - ?
>- ="exec dbo.PRO_GEBRUIKER @txt='" &
[quoted text clipped - 39 lines]
>> >> >parameter '@Facility'.
>> >> >Thanks,
Tom van Stiphout - 14 Jan 2008 02:41 GMT
I do speak Dutch - just not very familiar with new words like
scheidingsteken. But I do get the gist of it.

Upon some further investigation indeed my first suggestion does not
work. Rather the RecordSource should be:
exec dbo.PRO_GEBRUIKER 'SomeUser'

To set that, you can use an event procedure (e.g. Form_Open) or a
button-click event or some such.

It is too bad MSFT didn't fix the problems in ADP runtime, otherwise
you would have been able to use the InputParameters property (which
still works in the full version).  Personally I am disgusted about
this lack of support. I would be OK if MSFT would come out and say
they don't support ADP anymore and would encourage people to move on.
But this half-a.s attitude...

-Tom.

>so, I typ in the RecordSource property everything between -   - ?
>- ="exec dbo.PRO_GEBRUIKER @txt='" &
[quoted text clipped - 39 lines]
>> >> >parameter '@Facility'.
>> >> >Thanks,
korsakow - 14 Jan 2008 03:45 GMT
first of all: thanks for spending you time to my problem!

I don't understand: Rather the RecordSource should be:
exec dbo.PRO_GEBRUIKER 'SomeUser' : what is 'some user'?
I need to use the parameter @txt, because I can't make a query for each user
and I have also other query with query parrameters.

> I do speak Dutch - just not very familiar with new words like
> scheidingsteken. But I do get the gist of it.
[quoted text clipped - 58 lines]
> >> >> >parameter '@Facility'.
> >> >> >Thanks,
Tom van Stiphout - 14 Jan 2008 04:18 GMT
'SomeUser' is just a placeholder for some username that presumably
you'd want to pass into your sproc.
If you use an appropriate event (and I have to be this vague because I
don't know your app) you can set and set again as many times as you
need the RecordSource property of the form you are speaking of.

-Tom.

>first of all: thanks for spending you time to my problem!
>
[quoted text clipped - 65 lines]
>> >> >> >parameter '@Facility'.
>> >> >> >Thanks,
korsakow - 14 Jan 2008 05:01 GMT
I'm so sorry, but I don't understand you, I'll make is as simple as possible:
I have a simpel table. The query 'pro_gebruiker' has 1 field filtered bij
@txt.
@txt is on : [forms]![FRM_GEBRUIKER]![txtGetUserName].
the record source for FRM_1 is pro_gebruiker, so how/where can I add the
query parameter @txt? Do I have to make a vba code that execute on an
appropriate event, that add this parameter?

Please can you explain it step by step? But if it take to much time for you,
I'll understand that!
this stupid access runtime...
thanks a lot!

> 'SomeUser' is just a placeholder for some username that presumably
> you'd want to pass into your sproc.
[quoted text clipped - 73 lines]
> >> >> >> >parameter '@Facility'.
> >> >> >> >Thanks,
Tom van Stiphout - 14 Jan 2008 13:48 GMT
You may have to read up a bit on how to call sprocs. @txt is an
argument, but you don't have to specify it. So these are equivalent:
exec dbo.PRO_GEBRUIKER 'SomeUser'
exec dbo.PRO_GEBRUIKER @txt='SomeUser'

Yes, as I wrote, you have to write some VBA to set the RecordSource.
You write this code in "...the appropriate event...". Something like:
Me.RecordSource = "exec dbo.PRO_GEBRUIKER '" &
[forms]![FRM_GEBRUIKER]![txtGetUserName] & "'"

That's all I have to say about this.

-Tom.

>I'm so sorry, but I don't understand you, I'll make is as simple as possible:
>I have a simpel table. The query 'pro_gebruiker' has 1 field filtered bij
[quoted text clipped - 86 lines]
>> >> >> >> >parameter '@Facility'.
>> >> >> >> >Thanks,
korsakow - 15 Jan 2008 22:49 GMT
Super! It works great! THANKS A LOT!!
can you als give me an example of the code if i have multiple parameters?
example one parameter: Me.RecordSource = "exec dbo.PRO_GEBRUIKER '"
&[forms]![FRM_GEBRUIKER]![txtGetUserName] & "'"

> You may have to read up a bit on how to call sprocs. @txt is an
> argument, but you don't have to specify it. So these are equivalent:
[quoted text clipped - 100 lines]
> >> >> >> >> >parameter '@Facility'.
> >> >> >> >> >Thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.