If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: I ment Details_Subform. "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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. -- 2nd_Stage_User |
#12
|
|||
|
|||
|
#13
|
|||
|
|||
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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: I ment Details_Subform. "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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. -- 2nd_Stage_User |
#14
|
|||
|
|||
|
#16
|
|||
|
|||
I sent you a sample mdb, did you get it?
I sent it to "2nd_Stage_User" wrote: 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" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: I ment Details_Subform. "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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. -- 2nd_Stage_User |
#17
|
|||
|
|||
No, I didn't get it.
I gave up on the solution path we were pursuing, after you couldn't receive the mdb attachment in my 2nd email. Your efforts in sending me a sample database are greatly appreciated. Thank you for such efforts! However, I expect that I'll run into the same problem as you, relative to the 1st mdb that I sent you. Hotmail does not allow attachments with mdb, as I found out yesterday. Nonetheless, against "little hope," I'll check to see if I rec'd it. If I did get it, I'll send you a notice at your 2nd email address. Thanks again. -- 2nd_Stage_User "Ofer" wrote: I sent you a sample mdb, did you get it? I sent it to "2nd_Stage_User" wrote: 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" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: I ment Details_Subform. "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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 "Ofer" wrote: 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 "2nd_Stage_User" wrote: 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. -- 2nd_Stage_User |
#18
|
|||
|
|||
Form, Subform, Tab key
I was trying to do the same project and tried the code provided with the same
error msgs. I was not able to get this code to work at all. I searched for info on "setfocus" and came up with additional informtion that I have been successful in getting to work. My pages are identified as follows: main form = "Employees" 1st subform = "PullNotice" 2nd subform = "EmergencyInfo" I haven't figured out how or why but in my tab order list the PullNotice subform is listed so my last field on the main form automatically tabs to the first field in the 1st Subform. You'll probably have to add the code to your last field on the main form. I selected the last field on the 1st subform and entered the code as follows: Private Sub Deleted_from_Pull_Notice_Exit(Cancel As Integer) DoCmd.GoToControl "EmergencyInfo" DoCmd.GoToControl "EmergencyContact#1" End Sub The 1st DoCmd moves the cursor to the subform and the 2nd DoCmd moves it to the field (control). I wanted the last field in my 2nd subform to return to the first field ("LastName") on my main form. I entered the code again only eleminated the first DoCmd for the subform (I got errors when I left this line in). Private Sub Contact_2Relationship_Exit(Cancel As Integer) DoCmd.GoToControl "LastName" End Sub This worked for me and I am able to tab through all three forms over and over. I use the navigation arrows to move from record to record or select the employee from a drop down box in the header. Hope this helps! Perplexed |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
unlinked subform | Don Barton | Database Design | 5 | May 20th, 2005 12:23 AM |
Need to clear controls of Filter form | Jan Il | Using Forms | 2 | November 28th, 2004 02:04 PM |
open a form through a subform in access 2000 | Tammy | Setting Up & Running Reports | 12 | October 22nd, 2004 02:43 PM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |
Recordset in subform based on field in parent form | Lyn | General Discussion | 15 | June 14th, 2004 03:10 PM |