parameter qry

tuktuk

Well-known Member
Joined
Nov 13, 2006
Messages
856
hey there

i have a form with textbox "txt_Region" and the value is used as a parameter in a crosstab qry.

the values that i type in the text box are Numbers (1,2,3.....9) though. the issue is that in the qry that is parameterized it pulls from a table where the Region field is a text...it was build prior to me taking it over.

therefore, i declared the parameter Forms!FormName!txt_Region as Text.

if i go to the form and type in 2....then attempt to run the qry....i get no records.

if i remove the qry criteria ([Forms]![FormName]![txt_Region] and replace it with a 2, access auto quotes on the crieteria as "2" and then the qry returns records.

tis kind of goofy but might there be a work around? do i need to set the props of the txt box?

T
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
it appears i made this more difficult that it was........

as in, i still had my cursor in the textbox as i triggered the qry.....

with that said since it was still active it didnt log the number entered in the text box to use as the parameter. you live and you learn i guess.

T
 
Upvote 0
The reason for that is that the value isn't written to the database until you leave the textbox (not exactly, but near enough for now). So, relying on the parameter won't work -- you have a Null in the field until you exit the control.

Denis
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top