Serialize Function Problem (1 Viewer)

Ceebee86

Registered User.
Local time
Today, 05:47
Joined
Sep 9, 2019
Messages
25
Hi,

Isladogs was kind enough to point me to her updated code when I was having problems, yet I still am having issues and hoping its quick to fix.

The code works in my query if I don't place a where clause, if I remove it, it works fine. I get error 3061. Too few parameters, expected 1.

I need this every time I run this query, so it ranks the records from 1 to whatever, which I then intend to turn into an update query to use the data at a later date. It's for grouping purposes in long run.

Query - Test
Code:
SELECT tblGoodsINDetails.ID, tblGoodsINDetails.Description, tblGoodsINDetails.PalletCount, tblGoodsINDetails.DeliveryRef, tblGoodsINDetails.labeldetailsCOUNTER
FROM tblGoodsINDetails
WHERE tblGoodsINDetails.DeliveryRef=[Forms]![frmGoodsINNewpreadvise]![TextDeliveryRef];


Query - Query1

Code:
SELECT Serialize("Test","ID",[ID]) AS RowNum, Test.ID, Test.Description, Test.PalletCount, Test.DeliveryRef, Test.labeldetailsCOUNTER
FROM Test;
 

isladogs

MVP / VIP
Local time
Today, 13:47
Joined
Jan 14, 2017
Messages
18,207
The Serialize function doesn't play nicely with variables.
However its possible to work round this by populating a 'temp table' with the filtered data then running a rank order query on that

The attached quick example includes a form with 3 combo boxes and a subform.

Select the courseID, classID and assessment number then click the GetRankOrder button to view the results in the subform



For now, all three selections need to be made - I may make this more adaptable later.
If you only need one selection the code will obviously be far simpler

I haven't yet tried using the function with Leigh's recordset but that's worth investigating as well


EDIT: Updated attachment to v4A to fix error in rank order query!
 

Attachments

  • RankOrderForm.PNG
    RankOrderForm.PNG
    37.8 KB · Views: 99
  • AssessmentRankQueries_v4A.zip
    89.1 KB · Views: 53
Last edited:

Users who are viewing this thread

Top Bottom