View Full Version : subform linked to calculated field


John S
08-07-2001, 03:37 AM
I have a form displaying postcodes (amongst other things) from an underlying table MEMBERS. There is also a calculated field in the form which shows the first two letters of the current postcode. A separate query qryFirst2 simply usesthe LEFT function to return the first 2 letters of all the postcodes in the table.

Problem: I want to have a subform listing all records where the postcode starts with the same 2 letters as the one currently viewed on the form. When I try to create a subform the 'one' side only allows me to choose bound fields on the form - I can't set this to be the calculated 'first two' field.

Question: is there any way to get the 'one' side of a form/subform relationship to match a calculated field?

thanks
John
Bristol UK

Jonathan Kok
08-15-2001, 10:01 AM
Try basing your main form on a query instead of directly to the table, and add a field to the query that calculates the 1st two letters of your postcode field.
pcleft: Left([postcode], 2)
You should then be able to include the new field on your form, and link it to the subform.

John S
08-28-2001, 02:12 AM
Jonathan - many thanks, it now works OK