![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have to roll out a 2007 application with most users having only runtime Acces on their machines and the missing zoombox feature is an issue. I have so far done the following as an alternative: 1. Set up a global procedure that opens a popup, modal form with a single text box containing the text in the source control: Public Sub ProcMyZoombox(StrZoomText, StrZoomControl, StrOpenForm As String) On Error GoTo ProcMyZoombox_Err 'Open Popup Zoombox form, load with relevant text DoCmd.OpenForm "FrmPopup_MyZoomBox" Forms![FrmPopup_MyZoomBox]![TxtTextField] = StrZoomText ProcMyZoombox_Exit: Exit Sub |
#3
| |||
| |||
|
|
On 25/02/2011 12:58:19, "Malcolm" wrote: I have to roll out a 2007 application with most users having only runtime Acces on their machines and the missing zoombox feature is an issue. I have so far done the following as an alternative: 1. Set up a global procedure that opens a popup, modal form with a single text box containing the text in the source control: Public Sub ProcMyZoombox(StrZoomText, StrZoomControl, StrOpenForm As String) On Error GoTo ProcMyZoombox_Err 'Open Popup Zoombox form, load with relevant text DoCmd.OpenForm "FrmPopup_MyZoomBox" Forms![FrmPopup_MyZoomBox]![TxtTextField] = StrZoomText ProcMyZoombox_Exit: Exit Sub Try This (Courtesy of Stephen Lebans) Create a blank form with the timer interval set at 50 Then copy & paste this SNIP HELPFUL DETAILS! |
#4
| |||
| |||
|
|
"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in message news:ik8lmi$ck6$1 (AT) speranza (DOT) aioe.org... On 25/02/2011 12:58:19, "Malcolm" wrote: I have to roll out a 2007 application with most users having only runtime Acces on their machines and the missing zoombox feature is an issue. I have so far done the following as an alternative: 1. Set up a global procedure that opens a popup, modal form with a single text box containing the text in the source control: Public Sub ProcMyZoombox(StrZoomText, StrZoomControl, StrOpenForm As String) On Error GoTo ProcMyZoombox_Err 'Open Popup Zoombox form, load with relevant text DoCmd.OpenForm "FrmPopup_MyZoomBox" Forms![FrmPopup_MyZoomBox]![TxtTextField] = StrZoomText ProcMyZoombox_Exit: Exit Sub Try This (Courtesy of Stephen Lebans) Create a blank form with the timer interval set at 50 Then copy & paste this SNIP HELPFUL DETAILS! Thanks for that Phil, much obliged. It is overkill for my requirements, if I could only get the addressing syntax for the controls on the subform on a tab page right I would be home and hosed with my code - and I'd like to get it right anyway for future reference. My problem in summary is that code like this works: Forms![Frm_Master]![FrmSubFrm_WhitePage_Details].Form![Notes] = Me!TxtTextField - but the following doesn't - even when there is no subform involved, just a textbox on a page of the Tab control: Forms(StrOpenForm).Controls(StrZoomControl) = Me!TxtTextField (Please see original post for details) Cheers Malcolm |
#5
| |||
| |||
|
|
Private Sub MyField_DblClick(Cancel As Integer) * * Call ZoomIt(Me, ActiveControl.Name, ActiveControl) End Sub Phil- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
I have to roll out a 2007 application with most users having only runtime Acces on their machines and the missing zoombox feature is an issue. I have so far done the following as an alternative: 1. Set up a global procedure that opens a popup, modal form with a single text box containing the text in the source control: Public Sub ProcMyZoombox(StrZoomText, StrZoomControl, StrOpenForm As String) On Error GoTo ProcMyZoombox_Err 'Open Popup Zoombox form, load with relevant text DoCmd.OpenForm "FrmPopup_MyZoomBox" Forms![FrmPopup_MyZoomBox]![TxtTextField] = StrZoomText ProcMyZoombox_Exit: Exit Sub ProcMyZoombox_Err: MsgBox Error$ Resume ProcMyZoombox_Exit End Sub I call the proc using a standard call: ProcMyZoombox Me.ActiveControl, Me.ActiveControl.Name, Me.Name 2. Set up the OnClose event of the popup form to run this code: Forms(StrOpenForm).Controls(StrZoomControl) = Me!TxtTextField This is the line that gives me the problem., error message "The setting you entered isn't valid for this property" Works fine on a standalone form but I have a main form (Frm_Master) with a tabbed control and a series of subforms (such as FrmSubFrm_WhitePage_Details - both Form and Subform Control name) on the tab pages, from all of which I want to be able to use the zoombox alternative. If I try my code from a text box on the main form all is well but I get an error when the calling text box is on a page of the tabbed control or on a subform on such a page - I don't seem to be able to reference the target text box correctly. To eliminate the syntax issues related to addressing a control on a subform I tried using a control on a tab of the tabbed control - no subform involved - and the code fails. If I temporarily replace the "generic" code with something specific such as : Forms![Frm_Master]![FrmSubFrm_WhitePage_Details].Form![Notes] = Me!TxtTextField then all is well but as soon as I try to substitute the more general version of the code, it fails. Can anybody please point me in the right direction? |
#7
| |||
| |||
|
|
Private Sub MyField_DblClick(Cancel As Integer) * * Call ZoomIt(Me, ActiveControl.Name, ActiveControl) End Sub Phil- Hide quoted text - - Show quoted text - Hi Phil, Your Plan B is almost the same as I use. The most important difference is the definition of Zoom_it. I do: Sub Zoom_it(Frm As Form) DoCmd.OpenForm “ZoomBox”,,,,,,Frm.Name End Sub And then in the OnOpen event of Zoom_form: Private Form_Open(Cancel As Integer) ‘ instead of Frm I would use prevFrm to accentuate the form where you came from Dim prevFrmName As String prevFrmName = Me.OpenArgs ‘or eventually your strDField function if OpenArgs is more complex Set prevFrm = Forms(prevFrmName) Me!Text0 = prevFrm.ActiveControl End Sub On the ZoomBox form I have a “+”-button and a “-“-button, that increases or decreases Me!Text0.FontSize, In that way you are “really” zooming. Fun! By placing both the ZoomBox form and the Sub Zoom_it in a reference database, you can have this functionality available in every application. Imb. |
#8
| |||
| |||
|
|
Maybe I'm missing a key point in there, but it seems to me that this is almost the same problem as a custom input box. If I'm right about that, the important point is to open MyZoom in dialog mode passing the data to be edited in OpenArgs and have the calling form pull the data from the input form instead of messing about pushing the data back back and forth. *At least this way the MyZoom form does not have to know anything about the calling form or the control with the data. |
#9
| |||
| |||
|
|
Maybe I'm missing a key point in there, but it seems to me that this is almost the same problem as a custom input box. If I'm right about that, the important point is to open MyZoom in dialog mode passing the data to be edited in OpenArgs and have the calling form pull the data from the input form instead of messing about pushing the data back back and forth. *At least this way the MyZoom form does not have to know anything about the calling form or the control with the data. I do not know if you are referring to Phil’s reply or mine. In principle it is enough just to pass the the text value to the Zoom_form. And IF (but I do not know) the OpenArgs parameter is an ByRef parameter, you could return the edited value through OpenArgs. For just editing the text it is enough, and you do not have to know anything of the form and the controls on the form. For generalization purposes I have found that it is advantagous the pass the calling forms name in OpenArgs. But, it is a way of working. With the knowledge of the form, and so of the control to be edited, you can do some checking in the Zoom_form. Some controls on the calling form can be blocked or not, so may not be edited or may. It is not necessary to have this kind of decisions at each calling of the Zoom_form, but you can handle this from within the Zoom_form, by blocking the control in Zoom_form in the same way as in the calling form. Because of “knowledge” of the form, and so without additional information in OpenArgs. If you want to edit dates, you can display in the Zoom_form the date in your own format instead of the standard table format, because you know the control on the calling form is a date. Because you know what datatype you are editing, you can already check if the edited text is valid, that is correspoding to the datatype. And you can set a warning when the maximum size of a text is reached. |
#10
| |||
| |||
|
|
Actually I was replying to Malcom's post, but more to the thread than any particlar post. I prefer for a zoom box kind of thingie to be as dumb as possible, just like the built-in zoom box. I don't think I would ever provide a custom edit box for any thing other than a Text or Memo field so checking the type of the bound field in the calling form is a really low priority in my list of needs. OpenArgs is an argument of OpenForm and is read only. So that is not a viable way to return a value. -- Marsh |
![]() |
| Thread Tools | |
| Display Modes | |
| |