main form several subforms navigating

rdw456

Novice
Local time
Today, 11:15
Joined
Jul 20, 2012
Messages
43
Hi I have a main form with a table as its recordset. I have four subforms with queries as there recordsets all quering the same table but four different groups of data. they are linked to the main form with child master relationship. This all works well in regards to data entry and saving to the two tables. My problem is navigating from main table record to a previous record. all subform recordsets remain in the position they were left in. I move to a previous record on the main form I want have the focus on the first control and all subforms also on the first records. Present situation the focus is on the previous records position on the subform. In short I want to move to previous record on the main form at the first control and beable to tab through the main form and then each subform in the tab order. ( clear as mud )

Thanks in advance Bob
 
Which two tables? you say "...saving to the two tables." I understand you to say that the main form and the subforms all relate to the same table.

If so, that is very a bad design. Create 5 different areas on the one form.

What have I missed?
 
Hi into thanks for the reply. There are two tables main has date shift employee the second table has products that are catergorized into four types of products. I use four subforms with queries so each subform is used to enter one catergory of product this works very well for user imput. New records work great the problem is if I want to edit previous record the focus does not act like a new record and some times I have trouble locating where the focus is.

Thanks Bob
 
and some times I have trouble locating where the focus is.

Thanks Bob

Look up Conditional Formatting On Focus. You can set up a highlight colur to draw the attention to that control.
 
Why does it matter where focus is? It can be set when appropriate. It very easy to change a control's or control's header backcolor with a one function changing the color of the control or control header on the OnFocus event.
 
Hi may now be when i change to another record sometimes there are records you cant see unless you scroll to them with four subforms you dont know where the focus is thats the problem also some records may now be hidden giving the user the impression that they are not there. so when I change a record on the master form I want all four subforms set to the first record and the focus on the the first field on the master form it sounds simple but have been working on it for quiet a while with no success.

Thanks Bob:banghead:
 
Hi here is a better description of the problem

  • I open Frm_ShiftMain to a new record
Date defaults to today
Tab through the following adding data
Shift, employee, tax

On the main forms after insert event I insert data into the subform table
( it completes this o/k)
I set the allowaddittions = false to stop user from adding any more new records.

On all of the subforms oncurrent event I set focus to the sold field

Problem I want to move to the first subform with the Tab key to edit the data in the sold field and I have tried different events to try and move the focus to the first subform of the current record.

I have a sample mdb of the Problem

So any thoughts or help would be great as I have been working on this for a couple of weeks and have lost myself in the problem

Thank you Bob
 

Attachments

By design, the TAB key is used to transfer to the next control on a form. Using it for anything else is a very bad practice. Don't do it, ever.

Use CTL-TAB, maybe CTL-ALT (those keys are closer together) or any other key combination not assigned by Access, trapped by the Access OnKeyPress event, to setfocus where ever you want.
 

Users who are viewing this thread

Back
Top Bottom