jgoodman00
Programmer
- Jan 23, 2001
- 1,510
Ok, I have a form named frmPhotoViewer. This has a subform embedded in it called Subform_Loader. The user selects a record from a combo-box which contains a numerical code. This numerical code dictates which form opens in Subform_Loader (e.g. frmFence). Now, within the forms which load in Subform_Loader are another series of subforms.
This currently runs fine, but I need the user to be able to tab from one of the subforms (e.g. subform_remarks) to another subform (e.g. subform_location).
I have the following code in the 'on lost focus' event of the last control in SubformRemarks:
DoCmd.GotoControl "SubformLocation"
This works perfectly when frmFence is run on its own. So thinking that I simply needed to reference the subform in carefully when it was running through the frmPhotoViewer I changed the code into the following in the 'on lost focus' event'.
If frmPhotoViewerOpen = True Then
DoCmd.GotoControl "Forms!frmPhotoViewer!Subform_Loader!SubformLocation"
Else
DoCmd.GotoControl "SubformLocation"
End If
This works fine if frmFence is run on its own, but if it is run as a subform in frmPhotoViewer it does not work.
Does anyone know how I can reference this in to make it work???
Thanks
James Goodman
j.goodman00@btinternet.com
This currently runs fine, but I need the user to be able to tab from one of the subforms (e.g. subform_remarks) to another subform (e.g. subform_location).
I have the following code in the 'on lost focus' event of the last control in SubformRemarks:
DoCmd.GotoControl "SubformLocation"
This works perfectly when frmFence is run on its own. So thinking that I simply needed to reference the subform in carefully when it was running through the frmPhotoViewer I changed the code into the following in the 'on lost focus' event'.
If frmPhotoViewerOpen = True Then
DoCmd.GotoControl "Forms!frmPhotoViewer!Subform_Loader!SubformLocation"
Else
DoCmd.GotoControl "SubformLocation"
End If
This works fine if frmFence is run on its own, but if it is run as a subform in frmPhotoViewer it does not work.
Does anyone know how I can reference this in to make it work???
Thanks
James Goodman
j.goodman00@btinternet.com