I am trying to build a form as a type of interactive map, a copy of an
overhead view of farm land. I have 576 text control boxes, each represents a
single plot of land on the map. I want to be able to choose a single plot of
land, text box, and have it return only records that apply to it. Since all
boxes have the same control source, field "Plot ID" in table "Land", I do not
know what I can do, short of making a table with 576 fields and then linking
each form text box to a different table field. Is there a better way... I
know there is, but can you clue me in? Thanks a lot.
mscertified - 07 Jan 2008 18:51 GMT
You cannot have that many columns in a table anyway.
I'd make it an unbound form and load the 576 controls in code and save them
in code.
I'm not sure you can have that many controls on a form (I've never attempted
it), check Access Help to see.
Id have the table have a column called PlotID and have relevant data in the
same row or a related table.
-Dorian
> I am trying to build a form as a type of interactive map, a copy of an
> overhead view of farm land. I have 576 text control boxes, each represents a
[quoted text clipped - 4 lines]
> each form text box to a different table field. Is there a better way... I
> know there is, but can you clue me in? Thanks a lot.
Klatuu - 07 Jan 2008 18:57 GMT
Write a sub that opens the report based on the value selected text box.
In the After Update event of each text box, call the function and pass the
value for the text box to the function:
Me.txtPlot103_AfterUpdate()
Call DoReport("103")
Private Sub DoReport(strPlot)
Docmd.OpenReport, "MyReportName", , , "[Some Field] = '" & strPlot & "'"
End Sub
The code above assumes the field you are filtering on is a text field. If
it is numeric, it would be:
Docmd.OpenReport, "MyReportName", , , "[Some Field] = " & strPlot

Signature
Dave Hargis, Microsoft Access MVP
> I am trying to build a form as a type of interactive map, a copy of an
> overhead view of farm land. I have 576 text control boxes, each represents a
[quoted text clipped - 4 lines]
> each form text box to a different table field. Is there a better way... I
> know there is, but can you clue me in? Thanks a lot.