Rabu, 25 Juli 2012

[MS_AccessPros] using query results for a default value

 

Pros, I have a subform with an FK of ID from the PK of main form ID.

I need the subform to autonumber not the ID, but something called a LayerNum but only within the ID. That is, each ID of main record has multiple layers of sub.

So, I was thinking I could set the default value to a calculated field in a query.

SELECT Max([LayerNum]+1) AS [Next]
FROM TestSideLayers
GROUP BY TestSideLayers.ID
HAVING (((TestSideLayers.ID)=[Forms]![DSMain]![ID]));

And then have the form field default be: =[NextLayer]![Next]

However, I get that nasty #Name? business or whatever it is and it isn't working.

Liz Ravenwood
Programmer/Analyst
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar