Regarding Form and Subform Names, before beginning this thread, I had
re-Named each one. I re-Named them from the main database window (i.e. I
selected Forms on the Object bar of the main database window, and then I
re-Named each).
When I did this, my understanding was that the new Name would cascade over
all original Names. Apparently not, as the Names I sent you were the
original Names of the Subforms.
Subsequent to supplying you with Subform Names, I went into each Subform and
changed the Name property of each, to match the Name that currently displays
in the main database window.
However, I still can "not" find a Name property for the main form
(BM_DataEntry). I did what you said to find the Name property for
BM_DataEntry. There is "no" Name property on property sheet for
BM_DataEntry. There is Caption on Format tab, and Record Source on Data tab.
(I viewed all properties of BM_DataEntry, via All tab.)
One final note on Names, I have double-checked Names of all objects and
fields, in the database, and in the VBA code.
Please, note, I changed the split lines of code into one single line (just
as you have done in this latest reply). Now, I don't get any "error"
messages when Tabbing.
However, I can't Tab from "last field" of Details_Subform to "first field"
of SubjectHead_Subform. Cursor goes from "last field" of Details_Subform to
"first field" of Details_Subform. Continued Tabbing just recirculates cursor
thru fields of Details_Subform.
Also, if I "mouse" to "last field" of SubjectHead_Subform and hit Tab to
advance to "first field" of Author_Subform, the cursor goes back to "first
field" of SubjectHead_Subform.
In contrast with Tab results involving Details_Subform and
SubjectHead_Subform, and SubjectHead_Subform and Author_Subform, I can Tab
from "last field" of Author_Subform to "first field" of BM_DataEntry, and
from "last field" of BM_DataEntry to "first field" of Details_Subform.
Strange!
I will email you the database, but be warned it is about 500KB.
--
2nd_Stage_User
Ofer said:
I am on a different time zone
1. Open the main form in design view
2. Pess Alt+Enter to get the properties
3. press with the mouse on the frame of the second sub form, check the name
4. press with the mouse on the frame of the 3rd sub form, check the name
5. this names should be in the sub form name
6. Open the second sub form in design and click with the mouse to check the
name of the field you want to set the focus to
7. Do the same with the 3rd sub form
Now write the names
Forms![MainFormName]![SubFormName].Form![FieldName].setFocus
I have no problem checking your mdb, if you have no luck, and return it back
to fixed, I dont need the data if you worried about it.
So if you want, then send it to
(e-mail address removed)
:
No problem, regarding the delay. I figured you got tired of dealing with
this problem, or were in a different time zone and got tired and went to bed.
Anyhow, the "Name" of the SubjectHead_Subform is "SubjectHeadings1 subform."
To get the subform "Name," I right-clicked on 1/4" square that is
immediately to the left of the subform's horizontal ruler. From the
resulting pop-up menu, I selected Properties item. Then, I selected All tab
and viewed Name property. By the way, Source Object (below Name) is
SubjectHead_Subform.
If my method for finding Name property for SubjectHead_Subform is correct, I
can find Names for Details_Subform and Author_Subform. However, if this
method is correct, I can not figure how to find Name property for
BM_DataEntry. When I right-click the 1/4" square immediately to the left of
BM_DataEntry's horizontal ruler, there is no Name property on the All tab.
There is only Record Source.
--
2nd_Stage_User
:
Sorry for the delay
Open the form BM_DataEntry in design view, click on the sub form
SubjectHead_Subform and tell me what is name of the sub form. check the
properties of the sub form, and check the name
:
Oops! When I went to hit the "Reply" button, I accidentally hit the "Yes"
button, which indicates my question has been answered. "Yes," the question
has been answered, but "No," the answer is not working.
Ofer, I understood your instructions below, and I reproduced them exactly as
written. However, the code is not working. I get a different "run-time
error." This one specifies "2465" and says, "Microsoft Access can't find the
field SubjectHead_Subform referred to in your expression."
(This error message results when I tab from "last field" of 1st subform to
"first field" of 2nd subform. Also, the same error message occurs when I go
from 2nd subform to 3rd subform, with SubjectHead_Subform being replaced by
Author_Subform.)
Below are the exact code lines that I used:
1.) To move cursor from "last field" of 1st subform to "first field" of the
2nd subform, I typed the following:
Private Sub PageID_Exit(Cancel As Integer)
Forms![BM_DataEntry]![SubjectHead_Subform].Form!
[SubjectID].SetFocus
End Sub
2.) To move cursor from "last field" of 2nd subform to "first field" of the
3rd subform, I typed the following:
Private Sub PageID_Exit(Cancel As Integer)
Forms![BM_DataEntry]![Author_Subform].Form!
[AuthorID].SetFocus
End Sub
3.) PageID is the "last field" in all three subforms (Details_Subform,
SubjectHead_Subform, and Author_Subform, respectively).
4.) SubjectID is the "first field" of the 2nd subform.
5.) AuthorID is the "first field" of the 3rd subform.
--
2nd_Stage_User
:
It shold be
Forms![BM_DataEntry]![SubjectHead_Subform].Form![FirstFieldNameInSecondSubForm].Setfocus
The name of the sun forms should be the name of the sub in the main form,
and not the name of the form it self.
So the syntax should be
From the first sub form to the second one
Forms![Name of main form]![name of second sub form In the main
form].Form![First Field Name In Second Sub Form].Setfocus
To move from the second sub form to the 3rd one
Forms![Name of main form]![name of 3rd sub form In the main
form].Form![First Field Name In 3rd Sub Form].Setfocus
:
After a couple re-reads, I thought that was what you meant.
I did substitute Details_Subform, for BM_DataEntry's
Also, I made all the rest of the actual name substitutions, but code did not
work.
I got a "Run-time error:2450. Microsoft Access can't find the form
Details_Subform referred to in a macro expression or Visual Basic code."
I'm in the middle of reproducing exactly what I typed, and then I'll post
it, for your review.
Thanks.
--
2nd_Stage_User
:
I ment Details_Subform.
:
1. Open the subform called BM_DataEntry's in design view
I don't have a subform called BM_DataEntry's, so step #1 throws me a bit.
However, the remaining instructions are clear. I'll see if I can make them
work. I'll let you know.
Thanks for your help!
--
2nd_Stage_User
:
1. Open the subform called BM_DataEntry's in design view
2. Go to the properties of the last field in that form.
3. Choose the on exit property, and select code.
4. enter the code
Forms![BM_DataEntry]![SubjectHead_Subform].Form![FirstFieldNameInSecondSubForm].Setfocus
5. Do the same from the second to the 3rd subform, just change the names
HTH
:
Thank you for your reply, Ofer!
I followed your instructions, as best I understood them. What I "built" did
not work.
The main form is called BM_DataEntry, and it has several fields.
BM_DataEntry's 1st subform is called Details_Subform. Its 2nd subform is
called SubjectHead_Subform, and its 3rd subform is called Author_Subform.
Please, could you show the steps to move cursor from "last field" of 1st
subform to "first field" of 2nd subform (utilizing the names that I have just
supplied)?
Once I have these steps, I can apply them to "building code" for cursor
movement from 2nd subform to 3rd subform, and from 3rd subform back to main
form. Cursor movement from "fields in main form" to "fields in 1st subform"
is not an issue, because--for some reason--this occurs automatically (without
the need for me to do anything other than hit the Tab key).
--
2nd_Stage_User
:
On then OnExit Property of the fields where you want to move to the next sub
form, or back to the main form, just set a focus back to the required field
' Field on main form
Froms![MainFormName]![FieldName].setfocus
' Field on sub form
Froms![MainFormName]![SubFormName].Form![FieldName].setfocus
:
I have a Form, with 3 subforms in it. (The entire Form is intended for data
entry only.)
I want the Tab key to advance the cursor thru all fields (i.e. thru fields
of the Form, then thru fields of 1st subform, then thru fields of 2nd
subform, and finally thru fields of 3rd subform).
At this point, the Tab key advances the cursor out of the fields of the
Form, and into the fields of the 1st subform. However, the Tab key will not
advance the cursor out of the 1st subform, and into the 2nd subform.
Instead, when the cursor reaches the last field in the 1st subform, the Tab
key advances it back to the first field of the 1st subform (creating a new
record within 1st subform).
The Form is bound to one table, and each subform is bound to a separate table.