I am pretty sure this is going down the right lane for me, but being a
non-access code person, I am not quite certain of the details to accomplish
this.
a. Create an Unbound MainForm that has two Unbound text boxes, ie 'Street'
and 'City'.
b. ? Use the 'Subform/Subreport' tool to place a subform on the MainForm
b. ? Use the 'Subform/Subreport' tool to place a subform for all four
subforms on the MainForm
c. Create a Query that has the "WHERE (((Table_1.ShipName) Like "*" &
[Forms]![Table1]![shipname]) AND ((Table_1.ShipCity) Like "*" &
[Forms]![Table1]![Shipcity]));"
d. ? Create subforms 'Table1', 'Table2', etc to somehow display data from
the input of MainForm Textbox 'Street' and 'City' AfterUpdate event?
Sequence rearrangement here for convenience:
1. Create a new Form. Don't select ANY tables. Just use the toolbox textbox
wizard to put two textboxes on the form; name them txtStreet and txtCity.
Leave lots of room on the form. Save the form as frmMain.
2. Create a Query based on each of the four tables that you want to compare,
selecting those fields that you want to see.
Put a criterion on the Street field of
LIKE "*" & [Forms]![frmMain]![txtStreet] & "*"
and on City of
LIKE "*" & [Forms]![frmMain]![txtCity] & "*"
You'll now have four similar queries based on your four tables. Name them
something meaningful to you (e.g. not Query1, Query2 etc.).
3. Create a Form based on each of the four queries, using the forms wizard or
manually. Lay out the controls as you see fit. I'd suggest using Continuous
Form view so you can see multiple records.
4. Open frmMain in design view and drag each of the four new forms onto it.
You'll now have four subforms. Note the names that Access gives them (and
change them to something meaningful if Access' name isn't).
5. Select each of txtCity and txtStreet and view its properties. Find the
AfterUpdate event on the Events tab; select the Code Builder. Access will give
you a Sub and End Sub line; edit it to
Private Sub txtCity_AfterUpdate()
Me!subFirstSubform.Requery
Me!subSecondSubform.Requery
Me!subThirdSubform.Requery
Me!subFourthSubform.Requery
End Sub
and the same for txtStreet.
using the actual subform names.
Save the form.
Now open it and type in a city and street name. You should see the "hits" in
the four subforms.