Results 1 to 2 of 2
Thread: Form with Several Tabs (A2K)
2003-12-11, 22:44 #1
- Join Date
- Apr 2001
- Thanked 0 Times in 0 Posts
Form with Several Tabs (A2K)
I have an application with a main form that includes 10 tabs. The application currently has 4 versions of this form: 1 is for input, the tabs appear based on data entered in a previous tab; the others are inquiry / edit with different selection / search criteria, e.g. most recent entered first, by name, selected records. There is a lot of VBA code behind the forms to edit the data and control tab display. It takes a long time to compile the application. I want to minimize the effort to maintain the forms and make the application run more efficiently.
Is there a way to have one form with the selection criteria dynamically selected, e.g. change the underlying query? Can the form VBA be moved to a common module - I use the Me!field name reference extensively.
2003-12-11, 22:58 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Form with Several Tabs (A2K)
a) You can set a where-condition when opening the form using DoCmd.OpenForm:
DoCmd.OpenForm FormName:="frmMyForm", WhereCondition:="LastName = " & Chr(34) & "Jansen" & Chr(34)
[img]/forums/images/smilies/cool.gif[/img] You can change the record source of a form on the fly:
Me.RecordSource = "OtherQuery"
c) You will have to adapt your code if you want to move parts of it to a standard module, since "Me" has no meaning in a standard module. In many cases, you can use CodeContextObject instead of Me.