The structure was imported from excel ... (i.e.)
Athabasca Calgary Edmonton Viking
Acme 278 115 178 101
Lethbridge 301 75 350 377
Viking 234 278 50 0
Wetaskiwin 55 503 72 290
There are over 130 columns across (which will be added to)
and over 350 rows down (which will be added to). From
point A to point B equals the mileage.
The user of the query should be able to simply type in the
city "from" then then the city "to" and retrieve the
mileage between the two places.
Am have great difficulty with this. And, yes, some cites
have "periods" like "St. Paul" and others have two names
with "spaces" like "Fort Saskatchewan".
HELP!
-----Original Message-----
I don't know where the 20 limit comes from. I just tested a table with about
40 fields and they all showed up in the combo box.
What is your actual data structure? Do you have fields with city names? If
so, you should really consider normalizing. If you want to add another city,
you would have to add another field. This is generally not acceptable.
--
Duane Hookom
MS Access MVP
Shelka said:
This won't work as the combo box will only allow me to
select 20 "to destinations'. There are hundreds of "from"
and "to" cities ...
-----Original Message-----
Your data isn't quite normalized but you could:
Create a form that has two combo boxes. The first
displays all of the From
cities. The second would need to display the Field Names
(this is a type of
combo box row source). Call them cboFrom and cboTo
Then add a button with code (un-tested):
Dim dblMiles as double
dblMiles = DLookup(Me.cboTo,"tblA","[DestinationsFrom]
= """ & Me.cboFrom &
"""")
Msgbox "The miles between = " & Format(dblMiles,"0.00")
You may have issues with field names with spaces or
punctuation.
--
Duane Hookom
MS Access MVP
Have imported an Excel file into
Access ... "Destinations
From" left-side, row headings AND "Desinations To" as
column headings. From each city to each city a mileage
number is listed. How can I form a query where the user
would see a pop-up box that says: ENTER FROM CITY, then,
ENTER TO CITY, then the resulting mileage pops up?
.
.