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
|
|||
|
|||
"Musk" Form
Hello!
Two questions with connection: I have many Forms because there are litle "nuances" between they, as a result of different tables, with differents fields. 1 - Are there some procedure (?) to optimize this, to force only one "mask" Form read different tables, please? 2 - If the previous question is possible, is don't possible in each form, to show or not, the fields which don't exist in each table/record, with If [Field] = "..." Then [Field].Visible = True ? Any help is welcome. Thanks in advance. an |
#2
|
|||
|
|||
Both solutions are possible. For #1, change the Recordsource property of the
form in the code that opens it. For #2, your syntax is close: If Me.[ControlName] = "..." Then [ControlName].Visible = True Else [ControlName].Visible = False End If I'd also check out your tables to see if those "nuances" require multiple tables, or additional fields are the right design. In general, a table describes an entity and fields describe attributes of that entity. So, for instance both customers and suppliers can both go in the same table (they are companies or people) but require a few fields to describe their differences. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access "an" wrote in message ... Hello! Two questions with connection: I have many Forms because there are litle "nuances" between they, as a result of different tables, with differents fields. 1 - Are there some procedure (?) to optimize this, to force only one "mask" Form read different tables, please? 2 - If the previous question is possible, is don't possible in each form, to show or not, the fields which don't exist in each table/record, with If [Field] = "..." Then [Field].Visible = True ? Any help is welcome. Thanks in advance. an |
#3
|
|||
|
|||
You can reset a form's Recordsource in code. However, you can run into
problems if you've got controls on the form that are bound to fields that don't actually exist in the recordset. Toggling the control's visibility isn't really sufficient: you should also change the field's control source (to make it unbound). In your form's Open event, you can have code like: Select Case WhatForm Case 1 Me.RecordSource = "qryABC" Me.txtField1.ControlSource = "City" Me.txtField1.Visible = True Case 2 Me.RecordSource = "qryDEF" Me.txtField1.ControlSource = vbNullString Me.txtField1.Visible = False End Select -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "an" wrote in message ... Hello! Two questions with connection: I have many Forms because there are litle "nuances" between they, as a result of different tables, with differents fields. 1 - Are there some procedure (?) to optimize this, to force only one "mask" Form read different tables, please? 2 - If the previous question is possible, is don't possible in each form, to show or not, the fields which don't exist in each table/record, with If [Field] = "..." Then [Field].Visible = True ? Any help is welcome. Thanks in advance. an |
#4
|
|||
|
|||
Thanks for your reply.
#2 - Ok! #1 - This is what I have. One form to each table. From where... many identical forms. My question is another: If is possible we have only one "mask" form, to all tables and, anyway, to have any indicator to read certain table according to different situation? Thanks. an -----Original Message----- Both solutions are possible. For #1, change the Recordsource property of the form in the code that opens it. For #2, your syntax is close: If Me.[ControlName] = "..." Then [ControlName].Visible = True Else [ControlName].Visible = False End If I'd also check out your tables to see if those "nuances" require multiple tables, or additional fields are the right design. In general, a table describes an entity and fields describe attributes of that entity. So, for instance both customers and suppliers can both go in the same table (they are companies or people) but require a few fields to describe their differences. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access "an" wrote in message ... Hello! Two questions with connection: I have many Forms because there are litle "nuances" between they, as a result of different tables, with differents fields. 1 - Are there some procedure (?) to optimize this, to force only one "mask" Form read different tables, please? 2 - If the previous question is possible, is don't possible in each form, to show or not, the fields which don't exist in each table/record, with If [Field] = "..." Then [Field].Visible = True ? Any help is welcome. Thanks in advance. an . |
#5
|
|||
|
|||
Thanks for your opinion
an -----Original Message----- You can reset a form's Recordsource in code. However, you can run into problems if you've got controls on the form that are bound to fields that don't actually exist in the recordset. Toggling the control's visibility isn't really sufficient: you should also change the field's control source (to make it unbound). In your form's Open event, you can have code like: Select Case WhatForm Case 1 Me.RecordSource = "qryABC" Me.txtField1.ControlSource = "City" Me.txtField1.Visible = True Case 2 Me.RecordSource = "qryDEF" Me.txtField1.ControlSource = vbNullString Me.txtField1.Visible = False End Select -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "an" wrote in message ... Hello! Two questions with connection: I have many Forms because there are litle "nuances" between they, as a result of different tables, with differents fields. 1 - Are there some procedure (?) to optimize this, to force only one "mask" Form read different tables, please? 2 - If the previous question is possible, is don't possible in each form, to show or not, the fields which don't exist in each table/record, with If [Field] = "..." Then [Field].Visible = True ? Any help is welcome. Thanks in advance. an . |
#6
|
|||
|
|||
On Thu, 26 Aug 2004 03:24:34 -0700, "an"
wrote: #1 - This is what I have. One form to each table. From where... many identical forms. Well... it sounds like you have many identical (or nearly identical) TABLES, if you need many identical forms. Multiple tables with the same structure is probably a flaw in your table design. How do these tables differ? Are the for multiple subclasses of a single Entity? If so, you may want to consider using a single table with one additional field to classify the data. John W. Vinson[MVP] (no longer chatting for now) |
#7
|
|||
|
|||
Thanks for your reply.
The situation is the next: F_1, unbound, with 5 tab controls. Tab control11 for SubF_11 based in T_11; Tab control12 for SubF_12 based in T_12; up to Tab control15 for SubF_15 based in T_15; F_2, unbound, with 3 tab controls. Tabcontrol21 for SubF_21 based in T_21; Tabcontrol22 for SubF_22 based in T_22; Tabcontrol23 for SubF_23 based in T_23; .. . . F_9 with anothers tabcontrols for anothers SubF_ . . . The similarity between tables is because there are differents filds between them. My question is; Possibility, or not, to have only one together (Form and SubForm) to load determined table, according our necessity. The fields which don't exist in each Table and SubForm: If [Field] = "..." Then [Field].Visible = True Thanks in advance. an -----Original Message----- On Thu, 26 Aug 2004 03:24:34 -0700, "an" wrote: #1 - This is what I have. One form to each table. From where... many identical forms. Well... it sounds like you have many identical (or nearly identical) TABLES, if you need many identical forms. Multiple tables with the same structure is probably a flaw in your table design. How do these tables differ? Are the for multiple subclasses of a single Entity? If so, you may want to consider using a single table with one additional field to classify the data. John W. Vinson[MVP] (no longer chatting for now) . |
#8
|
|||
|
|||
On Sun, 29 Aug 2004 14:54:01 -0700, "an"
wrote: Possibility, or not, to have only one together (Form and SubForm) to load determined table, according our necessity. It's possible; what you could do is change the Recordsource of the form at the time you determine which table should be displayed. You can in addition use the form's Load event to toggle the visibility of controls on the form. Performance and stability might be better, though, if you had multiple forms. Rather than opening a form and changing its Recordsource, you could dynamically change the SourceObject property of the subform to the appropriate Form. I'm still queasy about your database design, but I'll leave that discussion for another time! John W. Vinson[MVP] (no longer chatting for now) |
#9
|
|||
|
|||
Thanks.
All the best. an -----Original Message----- On Sun, 29 Aug 2004 14:54:01 -0700, "an" wrote: Possibility, or not, to have only one together (Form and SubForm) to load determined table, according our necessity. It's possible; what you could do is change the Recordsource of the form at the time you determine which table should be displayed. You can in addition use the form's Load event to toggle the visibility of controls on the form. Performance and stability might be better, though, if you had multiple forms. Rather than opening a form and changing its Recordsource, you could dynamically change the SourceObject property of the subform to the appropriate Form. I'm still queasy about your database design, but I'll leave that discussion for another time! John W. Vinson[MVP] (no longer chatting for now) . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange stLinkCriteria behaviour on command button | Anthony Dowd | Using Forms | 3 | August 21st, 2004 03:01 AM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |
Creating a Form. Should I use Control or Form Toolbar? | Amy | General Discussion | 7 | July 1st, 2004 02:36 PM |
synchronizing form and list box | Deb Smith | Using Forms | 8 | June 21st, 2004 08:15 PM |
Form Doesn't Go To New Record | Steve | New Users | 15 | May 16th, 2004 04:33 PM |