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 |
#1
|
|||
|
|||
Finding a Forms Name
Where is the quickest way to find a forms name.
I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#2
|
|||
|
|||
The form's name is not shown in the properties window.
What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#3
|
|||
|
|||
I'm trying to use setfocus to go to a field on a subform. I need the name of
the parent and the subform, but the code is not working so I think I still don't have the correct names. This is the code I'm trying to use: me.parentform.subform.setfocus me.parentform.subform.form.fieldname.setfocus But, when I put in what I think the name of the form (either form) is and hit the "." no options come up - making me think the form name is incorrect. And, when I try to run the code, it errors. "Ken Snell [MVP]" wrote: The form's name is not shown in the properties window. What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#4
|
|||
|
|||
I assume that you're running this code from the main form's module. As such,
you don't care what the name of the main form is, as it's not needed for your purpose. You just need the name of the subform control (the control that is holding the subform) and the control name on the subform form. Me.SubformName.SetFocus Me.SubformName!ControlName.SetFocus Note that a field is not a control. You cannot set focus onto a field, as a field exists only in the form's recordsource. Controls may be bound to fields, but controls are what you see on the form. -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... I'm trying to use setfocus to go to a field on a subform. I need the name of the parent and the subform, but the code is not working so I think I still don't have the correct names. This is the code I'm trying to use: me.parentform.subform.setfocus me.parentform.subform.form.fieldname.setfocus But, when I put in what I think the name of the form (either form) is and hit the "." no options come up - making me think the form name is incorrect. And, when I try to run the code, it errors. "Ken Snell [MVP]" wrote: The form's name is not shown in the properties window. What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#5
|
|||
|
|||
Thank you.
After moving to the subform and entering data, I will then want to move to the parent form and set focus on a control there to continue data entry. So, I think I still need to be able to find the names of the forms somewhere won't I? Thx "Ken Snell [MVP]" wrote: I assume that you're running this code from the main form's module. As such, you don't care what the name of the main form is, as it's not needed for your purpose. You just need the name of the subform control (the control that is holding the subform) and the control name on the subform form. Me.SubformName.SetFocus Me.SubformName!ControlName.SetFocus Note that a field is not a control. You cannot set focus onto a field, as a field exists only in the form's recordsource. Controls may be bound to fields, but controls are what you see on the form. -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... I'm trying to use setfocus to go to a field on a subform. I need the name of the parent and the subform, but the code is not working so I think I still don't have the correct names. This is the code I'm trying to use: me.parentform.subform.setfocus me.parentform.subform.form.fieldname.setfocus But, when I put in what I think the name of the form (either form) is and hit the "." no options come up - making me think the form name is incorrect. And, when I try to run the code, it errors. "Ken Snell [MVP]" wrote: The form's name is not shown in the properties window. What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#6
|
|||
|
|||
No, in that case you just use this:
Me.Parent.ControlNameOnMainForm.SetFocus -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Thank you. After moving to the subform and entering data, I will then want to move to the parent form and set focus on a control there to continue data entry. So, I think I still need to be able to find the names of the forms somewhere won't I? Thx "Ken Snell [MVP]" wrote: I assume that you're running this code from the main form's module. As such, you don't care what the name of the main form is, as it's not needed for your purpose. You just need the name of the subform control (the control that is holding the subform) and the control name on the subform form. Me.SubformName.SetFocus Me.SubformName!ControlName.SetFocus Note that a field is not a control. You cannot set focus onto a field, as a field exists only in the form's recordsource. Controls may be bound to fields, but controls are what you see on the form. -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... I'm trying to use setfocus to go to a field on a subform. I need the name of the parent and the subform, but the code is not working so I think I still don't have the correct names. This is the code I'm trying to use: me.parentform.subform.setfocus me.parentform.subform.form.fieldname.setfocus But, when I put in what I think the name of the form (either form) is and hit the "." no options come up - making me think the form name is incorrect. And, when I try to run the code, it errors. "Ken Snell [MVP]" wrote: The form's name is not shown in the properties window. What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
#7
|
|||
|
|||
Thank you so much for your help
"Ken Snell [MVP]" wrote: No, in that case you just use this: Me.Parent.ControlNameOnMainForm.SetFocus -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Thank you. After moving to the subform and entering data, I will then want to move to the parent form and set focus on a control there to continue data entry. So, I think I still need to be able to find the names of the forms somewhere won't I? Thx "Ken Snell [MVP]" wrote: I assume that you're running this code from the main form's module. As such, you don't care what the name of the main form is, as it's not needed for your purpose. You just need the name of the subform control (the control that is holding the subform) and the control name on the subform form. Me.SubformName.SetFocus Me.SubformName!ControlName.SetFocus Note that a field is not a control. You cannot set focus onto a field, as a field exists only in the form's recordsource. Controls may be bound to fields, but controls are what you see on the form. -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... I'm trying to use setfocus to go to a field on a subform. I need the name of the parent and the subform, but the code is not working so I think I still don't have the correct names. This is the code I'm trying to use: me.parentform.subform.setfocus me.parentform.subform.form.fieldname.setfocus But, when I put in what I think the name of the form (either form) is and hit the "." no options come up - making me think the form name is incorrect. And, when I try to run the code, it errors. "Ken Snell [MVP]" wrote: The form's name is not shown in the properties window. What/when do you want to do this? -- Ken Snell MS ACCESS MVP "neenmarie" wrote in message ... Where is the quickest way to find a forms name. I've looked in the form's properties and find the name of the record source and the caption, but don't see the form's name there. I can find it by going into the switchboard menu and finding the name it is calling up, but if there is a subform on it, I can't find it's name. Thx Much |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
forms in Outlook 2003 | Marty Leaf | General Discussion | 1 | August 18th, 2004 06:13 PM |
FindRecord - Finding records between forms? | Solus | Using Forms | 1 | August 10th, 2004 11:23 PM |
datasheet forms open in form mode from the Switchboard | Paul James | Using Forms | 5 | July 13th, 2004 06:51 AM |
Word Forms? | CEVisker | New Users | 4 | June 21st, 2004 01:25 AM |
Forms Check Box not working | DLLower | General Discussion | 2 | June 17th, 2004 09:34 PM |