subform tab

B

beppe005

I have a form with 3 subforms (linked, the prevois to the next)which are
continuous forms, I wonder whether it is possible to move automathically the
cursor from one subform to the next when I finish entering the data instead
of using ctrl+tab.

subform01: I have 2 fields (date, import), after entering them I'd like the
cursor to go to subform02 (and so on)
subform02: I have one field (date of job)
subform03: I have 3 fields (hours, extra hours...)
subform04: I have 3 fields (quantity, material, cost)

Thanks in advance
Beppe
 
A

Arvin Meyer

You could use a SendKeys statement for Ctrl+Tab but you would need to know
logically when you were finished entering data. Usually subforms have
multiple records, so there would be no way to know. Even better than
SendKeys (which can be dangerous to use if another program becomes active)
is using the afterupdate event of the last control to SetFocus to the first
control on the next subform. Again, you cannot use multiple records in a
subform if you want to do this. The syntax to move to another record would
be something like:

Me.NameofSubformControl.Form.NameOfControl.SetFocus
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A

Arvin Meyer

A control is a textbox, option group, list box, page break, subform, etc. on
a form. In Access, these controls are sub-classed (which means little,
except I can say that they act like a picture until they get the focus)

A subform control is a picture of a another form which has a form property
when it gains focus (i.e. when you click in it) It has a Name property, and
a recordsource property, and a sourceobject property. The sourceobject is
the actual (sub)form that is embedded in the main form. It's recordsource is
a table, query, or SQL statement. It's Name is the name of the contol in the
mainform.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top