PDA

View Full Version : ?? Unbound controls on tablular forms ??



john-86
03-27-2006, 06:24 AM
Hello all, back for a lil more help if you don't mind.

I've set up a tabular form (actually a sub form) which has three unbound text boxes in it. There are two possibilities as two what these boxes may be populated with based on whether or not the record has an entry in another table. I've written code to distinguish between the two possibilities, but the values that are populated in the first record are just duplicated through the rest of the recordset (e.g. if the first box said "hello" all other boxes would say "hello").

It is as if the code that I wrote to distinguish between the two possibilities worked for the first record and then was not executed for the rest of the recordset. Instead a copy of the results from the first record is filled in for all records.

I know it all sounds a little vague. I'm trying to be as concise as possible. The only way I could explain it properly would be to type out the whole scenario, which I'm sure you busy people have no time for.

I was wondering if there was a way I could use a for each loop? Something along the lines of:

For Each Record in myRecordset
**code to distinguish between two possibilities**
Next

etc.

Thanks for your time everyone,
John

Norie
03-27-2006, 08:19 AM
John

It might actually help if we knew the whole scenario.

john-86
03-27-2006, 08:49 AM
It probably would, Norie. You're right. Here goes:

Just to kick off, I guess, I'm an ICT Trainee for a charitable heritage trust called the Shetland Amenity Trust. Shetland is an island archipelago North of Scotland and Orkney.

A bit of background:

I'm developing a Fishing Meids database. A fishing meid is a transect given by lining up two (or more) pairs of land features on the sea. A vector comes from pairing two land features and then the transect from where the lines cross. So, effectively, there are three stages:

1: land features (point data)
2: meids (line data)
3: fishing grounds (polygon data)

We have numerous databases here at the Trust. One of which being the Place Names database. Place names, very basically, gives a name to a grid reference, a feature. We thought it'd be a great idea to link tables to this database so we can pull in the majority of our point data from there.

The problem:
When entering data to the Place Names database if the feature of a large area (effectively a polygon) then a central grid reference is taken. Fishing meids don't work with general centralised points. They are quite often features on the coast, or they can be as vague as "the North side of". So, as well as entering the central grid reference in our Place Names database we also need a specific grid reference for a specific aspect of the feature.

I created another table so that these "aspects" could be recorded and used without causing any problems to the Place Names database.

In this subform (mentioned in previous post) the three unbound text boxes are the grid reference boxes. One for the NGR letters, one for the easting and one for the northing. I've developed code to determine whether or not to use the centralised grid ref (from the Place Names db) or an aspect grid ref (from my Meids db).

I've played with the code since my last post and now it duplicates the last record's grid references into every field.

I think the main problem is with the subform being tabular. Those three unbound text boxes are being referenced by the same name and are therefore all showing the same thing.

Is there any way I can fine tune where the record pointer is pointing?

Sorry for the lengthy explanation.

Kind regards,
John