Topic Options
#17026 - 04/29/09 11:24 PM Gridview for POA Receipts
SusanTennier Offline
Adagio Maestro

Registered: 02/22/08
Posts: 1247
Loc: Ontario, Canada
I'm working on a Gridview for POA receipts using I/R Comp (Lines, Header).

If I filter it by: {Rcpt #} = "RC 00001394" it produces results.

However, if I filter it by: {Rcpt #} = QUERYNUMBER("Enter Rcpt #" ,"RC 00001394" ) it opens up a query window that says, Enter Rcpt # and shows a default of 1394 which produces no results. If I type RC 00001394 in the query window it says, "Enter a Number" If I put quotes around the "RC 00001384" it says "Enter a Number". If I put 00001384 without the RC it produces no results.

Can anyone help? I want the Gridview user to be able to type in a particular receipt number in the query window and have the grid show the resulting items on only that particular receipt.
_________________________
Susan Tennier
TDL Canada
Trenton, Ontario

Top
#17027 - 04/30/09 01:00 AM Re: Gridview for POA Receipts [Re: SusanTennier]
Retired_Guy Offline
Adagio Master

Registered: 03/16/99
Posts: 10504
Loc: Canada
Aahh - the perenial confusion between numbers and text.

While you want the user to enter a number, you really need the value to be text when you use it to locate the record by the key. Fortunately, GridView allows you to turn numbers into text using the STRING(value,mask) function. You're also going to need to add the text "RC " to the beginning of the text, and you're going to need to add some zeros to make everything the right length.

First things first.

Ask for the receipt number:
Code:
QUERYNUMBER("Which receipt?",0)

Now, convert what they enter into text:
Code:
STRING(QUERYNUMBER("Which receipt?",0),"###")

Now, add 7 leading zeros to whatever they entered:
Code:
CONCATENATE("0000000",STRING(QUERYNUMBER("Which receipt?",0),"###"))

but we only need the rightmost 8 characters from the string:
Code:
RIGHT(CONCATENATE("0000000",STRING(QUERYNUMBER("Which receipt?",0),"###")),8)

but the we need to put the text "RC " at the front:
Code:
CONCATENATE("RC ",RIGHT(CONCATENATE("0000000",STRING(QUERYNUMBER("Which receipt?",0),"###")),8))

Now you have to put all that in the filter:
Code:
{Rcpt #} = CONCATENATE("RC ",RIGHT(CONCATENATE("0000000",STRING(QUERYNUMBER("Which receipt?",0),"###")),8))

Voila!

But wouldn't it be easier to have all the receipt lines in a grid and use the ctrl-f find to locate the row with the receipt you're looking for?
_________________________
Andrew Bates

Top
#17029 - 04/30/09 10:07 AM Re: Gridview for POA Receipts [Re: Retired_Guy]
SusanTennier Offline
Adagio Maestro

Registered: 02/22/08
Posts: 1247
Loc: Ontario, Canada
This is genius! Like I would have figured this out. NOT!
_________________________
Susan Tennier
TDL Canada
Trenton, Ontario

Top
#17031 - 04/30/09 10:24 AM Re: Gridview for POA Receipts [Re: SusanTennier]
Retired_Guy Offline
Adagio Master

Registered: 03/16/99
Posts: 10504
Loc: Canada
HI Susan,

Glad this all made sense.

Take heart - you don't just "arrive" at the final formula (unless you've been doing this for a long time). The trick is to decide the destination and know the starting point. Then, place te starting formula in a computer column and keep adding the steps one by one. Placing each step in an adjacent column, refering back to the last step, can help with the trial and error process of building a complicated formula. Once you have it working in the final column, you can combine all the intermediate columns into a single formula.

But a note - you should decide whether my final comment about having the whole list of receipts in a View and using the ctrl-f Find in GridView to find the one you're looking for wouldn't be faster.
_________________________
Andrew Bates

Top
#17044 - 04/30/09 02:15 PM Re: Gridview for POA Receipts [Re: Retired_Guy]
SusanTennier Offline
Adagio Maestro

Registered: 02/22/08
Posts: 1247
Loc: Ontario, Canada
Thanks.. I'll remember to come back to this post for future reference when creating new gridviews. Selecting the receipt number with the query is tidier than using ctrl-f because the list is too long. There are many receipts and each has multiple items. I linked the Receipt List by the Item # to another gridview that shows which customers have those items on back order to help with releasing back orders as the product arrives in the door.
_________________________
Susan Tennier
TDL Canada
Trenton, Ontario

Top
#17047 - 04/30/09 02:26 PM Re: Gridview for POA Receipts [Re: SusanTennier]
Retired_Guy Offline
Adagio Master

Registered: 03/16/99
Posts: 10504
Loc: Canada
How about having a grid with the vendors, clicking on a vendor to show their receipts only, then clicking on ther eceipt you're interested in.

I only suggest this if the sequential scan of the receipts that your filter will require takes too long. The linked Views in GridView will utilize indexes so will be fast.

There are tradeoffs in everything in life.
_________________________
Andrew Bates

Top


Moderator:  Christa_Meissner 
Who's Online
1 registered (1 invisible), 120 Guests and 0 Spiders online.
Key: Admin, Global Mod, Mod
Forum Stats
1865 Members
5 Forums
14467 Topics
70662 Posts

Max Online: 432 @ 01/20/25 10:17 PM
April
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30