![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"Ron Paii" wrote in message news:jbt1ph$v82$1 (AT) dont-email (DOT) me... That is cool! OT: I have a form with a private temp table record source that would be useful to open more then once. Would I need multiple tables and change the record source for the 2 and 3rd instance of the form? I once saw a sample application using class modules but I can't find it. You can most certainly change the record soure of a form. eg: Dim f1 As New Form_testform Dim f2 As New Form_testform Dim f3 As New Form_testform f1.RecordSource = "select * from customers1" f1.Visible = True f2.RecordSource = "select * from customers2" f2.Visible = True On the other hand, as above shows, needing multiple tables to be used with the SAME format suggests a normalizing problem. Perhaps just adding a single column to the table that distinguishes each table would mean then you just filter the form by that new column, not have to work with and maintain multiple copies of the same table. |
#12
| |||
| |||
|
|
"Wilhemina" wrote in message news:beb3a098-94c5-4d3e-afdd-47d6fa71c48f (AT) o1g2000vbe (DOT) googlegroups.com... The alternative would be to have a 'wrapper' form that contained only a subform control in which it loaded the form I wanted to instantiate. In this case I could hard-code the form name since it would always by the same: set frm= new Form_WrapperForm frm!SubForm.SourceObject="MyForm" Is there a better way to do this? Golly, I don't think so. Your sub form idea is almost close here. I would have hopped something like this: Dim f As Form Set f = db.Containers("forms").Documents("myForm") However, containers returns a document type object, not form. The best best is to create a routine with case statements, and for each form you add, then you add a case statement. eg: Public Function GetFormInstance(strForm as string) as Form select case strForm case "frmCustomers" set GetFormInstance = form_frmCustomers etc. If you do cook up something better, I would love a solution for this. I have a number of application where I allow multiple instances of a form to be opened at the same time. I mean, even allowing a user to minimize the current form while on a phone, and launch another copy of the same form can often be rather useful. I looked for a solution to your question, but decided that simply hard coding some case or if/then was the best I could find. -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada Pleasenospam_kal... (AT) msn (DOT) com |
![]() |
| Thread Tools | |
| Display Modes | |
| |