Frank,
As you have discovered, if you want to identify the grid ref of a
sighting by reference to the locations as listed in the Locations table,
then each defined Location can only have one associated Grid Ref. As
you can see from the query, the Grid Ref in the query, and hence on the
form, is in the Site Locations table, associated with the specific
Location. If you edit this on the form, you are in effect editing the
Grid Ref in the Site Locations table. In these sorts of circumstances,
it is probably usual practice for the Grid Ref textbox on the form to
have its Locked property set to Yes to prevent accidental tampering with
lookup reference data.
How to handle it will depend to some extent on the real-life data
recording practices. One way is for each distinct grid reference to be
included in the Site Locations table as a separate record. This would
mean one of these scenarios:
1. Persisting with the current concept of the Location field being the
key identifier, and therefore having to enter a distinct name for the
Location of each Grid Ref you use.
2. Using the Grid Ref instead as the key field, so you could have more
than one grid reference with the same Location name. The implication of
this is that the Sightings table will have a Grid Ref field instead of a
Location field, and this would be the basis of the relationship with the
Site Locations table.
3. Add another field, Autonumber data type, let's call it LocationID,
to the Site Locations table, and this is the primary key field. This
gives you total freedom to enter whatever Location names and grid
references you like, which will be available to you via the query for
your reporting and data export. And the Sightings table will record the
LocationID via the combobox.
On the basis of what I know so far about your project, I would rank
these 3, 2, 1. Of course, this implies a change in the data structure
which would require an adjustment to, or re-entry of, any existing data.
The other option, of having a Grid Ref as well as a Locatio field in the
Sightings table, would not be a good idea in my opinion.
As regards scrolling in the combobox, I'm sorry I don't myself have a
mouse with a wheel, so I am not familiar enough to give an answer, but
as far as I know it is not possible to do what you ask. Are you aware
that if the Auto Expand property of the combobox is set to Yes, this
means you can move to that section of the combobox list alphabetically
by typing the first, and then subsequent, letters of the item you want.?
And if the list of items is long, it may help to do this code on the On
Load event of the form...
Dim lngTemp As Long
lngTemp = Me.YourComboboxName.ListCount
By the way, as an aside, the word Date has a special meaning in Access
(it is called a 'reserved word') and as such it is not a good idea to
use it as the name of a field or control.
--
Steve Schapel, Microsoft Access MVP
Steve
Another question!
In the database I have a list of 'Locations' each with an associated
'Grid Ref' contained in a 'Location' table.
On the 'Sightings form' I have the 'Location' as a combo box and the
'Grid Ref' as a text box (I know the Grid Ref box is not really needed
on the form but you will understand when you read on)....all works well
when running the 'Sightings Query'.
However, there are times when I need to use the same 'Location' from
the combo but with a more accurate grid reference than the one
associated with it in the 'Location' table.
When I tried putting the accurate grid ref into the form, the grid refs
in both the location table and all previous records at that location
changed to the new typed in value.
So is it possible for the database to allow me to enter a more accurate
Grid Ref when needed but to default to the associated Grid Ref if I
don't type one in?
Also just noticed another problem...Adding new records via the
sightings form...sightings table updates with new sightings but the
'sightings query' doesn't update at the same time.
P.S. After looking at this, the Query doesn't update if I use a
'Location' other than those in the combo box, i.e. when I type in a new
'location'.
So I need the flexiblilty to add new 'locations' and 'grid refs' which
are not contained in the combo. Would I need to add these new locations
and grid refs to the locations table for this to work or is there
another way?
Here is the sightings query SQL:
SELECT Sightings.Date, Birds.Species, Birds.[Scientific Name],
Birds.[Cawos ID], Sightings.Number, [Site Locations].Location, [Site
Locations].[Grid Ref], [Site Locations].[Site ID], Sightings.Comments
FROM [Site Locations] INNER JOIN (Birds INNER JOIN Sightings ON
Birds.Species = Sightings.Species) ON [Site Locations].Location =
Sightings.Location;
Hope you understand.
Just one other thing... how do I get the comboboxes to scroll down
using the wheel on the mouse rather than the scroll bar?
Thanks
Frank