text box issue

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I have a group of text boxes where I input data into, which go into
the criteria of a query. This works out fine when I run the report
with these criterion. My question is: one of my text boxes is an item
#, is there away to make it where I can put numerous item #'s in there
to look for more than one?

I was thinking about creating a subform where the items inputted would
go into a table. Then somehow linking that table field data to the
textbox giving multiple item #'s in the text box. The text box is
already linked to the query. Is this possible or what would be a good
way to go about this?


Ryan
 
Ryan, the query would not be able to use the text box directly. You would
need to code a filter for the form instead of using criteria in the query.

The code would parse the list of numbers into an array, using Split() to
break them apart at the delmiter (space between numbers?) You would then
loop through the array, building up the filter string to use the IN
operator. If you had typed into the box:
45 678 899
the filter string would end up as:
[ItemNumber] IN (45, 678, 899)

You will need some understanding of VBA to implement this.
 
Is VBA the only way to do this? Couldn't I make a form where I imput
as few or as many items I want to go to a table recordset? Can the
query pull the field data in like how a combobox pulls a table field
in to populate the combobox? Or something similar to this approach?

Ryan, the query would not be able to use the text box directly. You would
need to code a filter for the form instead of using criteria in the query.

The code would parse the list of numbers into an array, using Split() to
break them apart at the delmiter (space between numbers?) You would then
loop through the array, building up the filter string to use the IN
operator. If you had typed into the box:
45 678 899
the filter string would end up as:
[ItemNumber] IN (45, 678, 899)

You will need some understanding of VBA to implement this.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


I have a group of text boxes where I input data into, which go into
the criteria of a query. This works out fine when I run the report
with these criterion. My question is: one of my text boxes is an item
#, is there away to make it where I can put numerous item #'s in there
to look for more than one?
I was thinking about creating a subform where the items inputted would
go into a table. Then somehow linking that table field data to the
textbox giving multiple item #'s in the text box. The text box is
already linked to the query. Is this possible or what would be a good
way to go about this?
 
You will not be able to enter multiple values into a text box and use that
text box directly in the query.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Is VBA the only way to do this? Couldn't I make a form where I imput
as few or as many items I want to go to a table recordset? Can the
query pull the field data in like how a combobox pulls a table field
in to populate the combobox? Or something similar to this approach?

Ryan, the query would not be able to use the text box directly. You would
need to code a filter for the form instead of using criteria in the
query.

The code would parse the list of numbers into an array, using Split() to
break them apart at the delmiter (space between numbers?) You would then
loop through the array, building up the filter string to use the IN
operator. If you had typed into the box:
45 678 899
the filter string would end up as:
[ItemNumber] IN (45, 678, 899)

You will need some understanding of VBA to implement this.


I have a group of text boxes where I input data into, which go into
the criteria of a query. This works out fine when I run the report
with these criterion. My question is: one of my text boxes is an item
#, is there away to make it where I can put numerous item #'s in there
to look for more than one?
I was thinking about creating a subform where the items inputted would
go into a table. Then somehow linking that table field data to the
textbox giving multiple item #'s in the text box. The text box is
already linked to the query. Is this possible or what would be a good
way to go about this?
 
Back
Top