Navigation Control Question

Sanchocow

Registered User.
Local time
Today, 13:23
Joined
Feb 25, 2008
Messages
10
I have a main form frmContacts and a subform sbfRA that has repair requests. These two are linked by the key ContactID. The Repair requests have primary key RA which is autonumbered. I am wondering what the easiest way is to have my navigation buttons go through all the records in the RA table and order by RA Number. If I put the Navigation buttons in the subform, then it only lists the RA's relative to the contact in the main form. Putting the buttons in the main form lists all the contacts, but then you have to navigate on the subform to get the RA Numbers and it is ordered by ContactID. Maybe there's some way to reference the RA Number in the main form? Or change the recordsource to a join query for navigation, but it seems like there should be something easier.
Thanks.
 
If your forms are based on queries and not tables, you should be able to sort them in any order you wish
 
The forms are based on tables so that new entries can be added, the main form is used to search for or enter a contact and then a repair subform is filled out for that contact and added to the repairs table. I just want the form to show and be able to navigate through all of the repairs ordered by the RA Number e.g. repair form number so that it is easier to view the most recent repairs
 
sounds like you need a form specifically for this purpose (listing all RA's by RA #). Your form/sub-form design should be designed so that you can look at all RA's by Customer/Contact, and since you want a list of all RA's, then another different seperate form is probably your best bet.

If you don't want to go through re-designing an RA display form, because you like the look of your sub-form, then you can create a form that lists the "header" information for all RA's, then when the user selects the RA they want, your sub-form opens on it's own (nothing says your sub-form can not be used as a main form, the only reason it is filters is because of the link master/child ID which is a property of the main form).
 
I guess I can make a main display form from a joinquery that lists all the ra's in order and will still be updatable and then launch the other form/subform that I have when a new entry is needed, shouldn't be too much of a problem I was just hoping there was a way to organize it all on one window
 
it might be possible to use a checkbox on the main form, to control wether you want a "filtered" sub-form or "all" records and have the code behind the checkbox change the main forms property making it unbound and changing the source of the sub-form control, thus breaking/unreleasing the master/child relationship.
 
sanchocow said:
The forms are based on tables so that new entries can be added
I believe you're laboring under a misconception here! Not all queries produce read-only forms! Some do and some don't, depending on how the multiple tables are joined. But a query based on a single table is certainly going to allow updating!

All forms, even ones using data from a single table, should be based on a query, for the very reason you see here; queries are designed to manipulate data! Crank up the Query Design View, add your table, include all your fields from the table in your query, and sort your data as you want it to appear on your form. If you should ever want the sorting to be done on multiple fields, remember that the query grid sorts from left to right.

Go into Design View for your form now, and change the Record Source from the table to the query.

The only thing you have to remember when using a query as a Record Source is that if you add a field to your table, down the road, to make it available to your form/report you'll have go back into the Query Design View and add the field to the query.

Linq
 

Users who are viewing this thread

Back
Top Bottom