Lebans or anyone please help me with continous form and tabs

H

HC

Here is my program

Table --- First, last, zip, etc...

main form ---- continuos form only display the first and last

In the mainform footer i've add an subform with contain my tabs for
more information.

Here is the problem

it's working great on the edit but i can not move get the cursor move
to the first field on the subform when the user click on the continuos
form (Main form). Both main and sub forms are driving from the query.

I have an add button on this form, when the user click the button, i'm
adding a record via code but can not refesh the form to point at the
record I just have added.

If you can help me and show me how to move the cursor into the subform
(Tabs) when the user click on the main form (continous form) i do
appreciate a lot.

Please be more specific and give me some example if you have it.

One more thing, in my subform i have a tabs (personal, company,
income). How can i refer the state field in the personal tab when i'm
in the Income tab ? What is the syntax on the name ?

Thank you all and please help me. you can email me at
(e-mail address removed).
 
A

Albert D.Kallal

The trick to do this invoices two steps. You first set the focus to the
sub-form, and THEN to the control.

So, you go:

' run your code to add, or do whatever

then..

me.mySubFormContorloName.SetFocus

Then, set the focus to the field you want..

me.mySubFormContorlName!Controlname.setfocus
One more thing, in my subform i have a tabs (personal, company,
income). How can i refer the state field in the personal tab when i'm
in the Income tab ? What is the syntax on the name ?

If that other field is simply another field on the form, it don't matter
which tab it appears on, you can still reference it as a regular field (the
tab does nothing to change how you ref the contorl).

So, in sub-form code,

me.State (or whatever you called the control).
 
H

HC

Thank you. That's do the job. By the way, what is the long name if i
want reference one of the field on the tabsform from another subform.

for example, i have a tabs subform name sub1 and a field name state
when i activate another subform sub2 and like reference the value of
the state field on sub1 ... what is the long name ? hope i do make
some sense.

Thank you for your help on the cursor move. Love it.
 
A

Albert D.Kallal

You can always use a full reference name, but that often gets quite long.

So, you can use

forms!FormName!SubFormName!SubFormContorl

However, just like we use "me" for the current form, you can use "parent" to
get the parent form name.

So, lets assume subform1, and subform2. and a main form called mainform.

We are in subform2, and we want the CompanyName field from subform1. We can
use

forms!MainForm!subform1!CompanyName

Note that the subform "form" can be refrenced via the .form properoty, and
the CORRECT syntax is actually:

forms!MainForm!subform1.form!CompanyName

However, the shortest address we can use is:

me.Parent.subform1!CompanyName

What is nice about the above is we don't have to know, or care about the
main form name!!

so,

me = current form (subform2)
me.parent = main form (mainform)
me.parent.Subform1.form = sub form 2 (subform2)
 

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