Random number append query fails, why?

E

efandango

I have an append query that has a Rnd number element that I want to use as
part of an append table query, but whenever I run it, or no matter what
number formats I use within the query or table, I get a cannot append due to
Type conversion Failure.

Can somebody tell me where I an going wrong? Both my query and table number
formats are currently set to General.


This is my query:


INSERT INTO tbl_Point_2_Point_2 ( Point2Point_ID, Run_No, Point_ID1,
Run_point_Venue, Run_point_Address, Run_Point_Postcode, RandomSeed )
SELECT DISTINCTROW TOP 18 (select count(subtable.Point_ID)+1 from tbl_Points
as subtable where subtable.Point_ID < tbl_Points.Point_ID and
(((subtable.Run_No) Between [Forms]![frm_Runs].[cbo_Point2Point_From] And
[Forms]![frm_Runs].[cbo_Point2Point_To]))) AS recordnum, tbl_Points.Run_No,
tbl_Points.Point_ID, tbl_Points.Run_point_Venue,
tbl_Points.Run_point_Address, tbl_Points.Run_Point_Postcode, Rnd([recordnum])
AS RandomSeed
FROM tbl_Points
WHERE (((tbl_Points.Run_No) Between
[Forms]![frm_Runs].[cbo_Point2Point_From] And
[Forms]![frm_Runs].[cbo_Point2Point_To]) AND ((tbl_Points.Custom_Point)=0));
 
A

Allen Browne

It may help to declare the parameters, so Access knows the data type (Long?
Double?) Choose Parameters on the Query menu, and enter 2 rows like this:
[Forms]![frm_Runs].[cbo_Point2Point_From] Double
[Forms]![frm_Runs].[cbo_Point2Point_To] Double

But my experience is that Access has trouble executing action queries that
contain a subquery. When you select a field that contains a subquery, that
query is read-only. I don't see any valid reason why it can't append that to
another table, but it can throw a 'must use updatable query' error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top