|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I have 4 fields on a form that are as follows: [Callers name],[town],[software], and [comments]. I have two tables involved in my problem: [Call log] and [town]. What I’m look to accomplish is that when I select a town in the combo box of the form, it will update the software field. Now the town table has two columns: [Towns] and [Software]. For an example, when I select a Concord for my town field of my form, it will add the second column to the software field. Any suggestions?
What I’m currently trying is ME.software.value = Me.town.column(1) in the after update of the town combo box and I have also tried it in the software text box? I can’t get it to work properly. Am I forgetting something? I have the town combo box set to column count 2, widths 1â€;0â€, bound column 1.
|
|
Jeremy,
It's important to distinguish between *fields*, which are stored in tables, and form *controls* which display data on forms, and which may be Bound to a field in the form's underlying RecordSource, Bound to an expression, or be Unbound.
To avoid referential ambiguity as well as obtain other benefits, most developers name their controls something other than the field they display, normally the field name with a 3-character prefix that identifies the control type, e.g., cboTown, txtSoftware.
I suspect that this is what's causing the problem when you try to set the value in the AfterUpdate event.
By the way, strictly speaking, you should use the Bang (!) operator with Me since the your control is part of the form's Controls collection, however, the dot (.) operator will work if there is no referential ambiguity. In an expression assigned to a Control Source, Me has no meaning, and is not necessary.
So, assuming the Town combo box is named cboTown, set the ControlSource of the textbox to display the Software field as:
=cboTown.Column(1)
Sprinks
"Jeremy Corson" wrote:
[Quoted Text] > I have 4 fields on a form that are as follows: [Callers > name],[town],[software], and [comments]. I have two tables involved in my > problem: [Call log] and [town]. What I’m look to accomplish is that when I > select a town in the combo box of the form, it will update the software > field. Now the town table has two columns: [Towns] and [Software]. For an > example, when I select a Concord for my town field of my form, it will add > the second column to the software field. Any suggestions? > > What I’m currently trying is ME.software.value = Me.town.column(1) in the > after update of the town combo box and I have also tried it in the software > text box? I can’t get it to work properly. Am I forgetting something? I have > the town combo box set to column count 2, widths 1â€;0â€, bound column 1. >
|
|
Sprinks, Thank you. After i got into learn this program i was reading this technique of useing tblCall, and other prefixes. Now i wish i had used them but now the database is much larger and would take me a large amont of time to convert it over to use these prefixes. Any suggestions to correct all of this? As for the me command, i can take that out and use "forms" correct?
I changed it to Forms![call log]![software]!value = forms![call log]![town]!column(1) and it return an error saying " Run-time error '451': Object not a collection. Because this is a Bound object i can not just set the control source to that. Is there anything i can provide you with to help drive an awnser? I'm even willing to upload an old verison of this DB some where.
"Sprinks" wrote:
[Quoted Text] > Jeremy, > > It's important to distinguish between *fields*, which are stored in tables, > and form *controls* which display data on forms, and which may be Bound to a > field in the form's underlying RecordSource, Bound to an expression, or be > Unbound. > > To avoid referential ambiguity as well as obtain other benefits, most > developers name their controls something other than the field they display, > normally the field name with a 3-character prefix that identifies the control > type, e.g., cboTown, txtSoftware. > > I suspect that this is what's causing the problem when you try to set the > value in the AfterUpdate event. > > By the way, strictly speaking, you should use the Bang (!) operator with Me > since the your control is part of the form's Controls collection, however, > the dot (.) operator will work if there is no referential ambiguity. In an > expression assigned to a Control Source, Me has no meaning, and is not > necessary. > > So, assuming the Town combo box is named cboTown, set the ControlSource of > the textbox to display the Software field as: > > =cboTown.Column(1) > > Sprinks > > "Jeremy Corson" wrote: > > > I have 4 fields on a form that are as follows: [Callers > > name],[town],[software], and [comments]. I have two tables involved in my > > problem: [Call log] and [town]. What I’m look to accomplish is that when I > > select a town in the combo box of the form, it will update the software > > field. Now the town table has two columns: [Towns] and [Software]. For an > > example, when I select a Concord for my town field of my form, it will add > > the second column to the software field. Any suggestions? > > > > What I’m currently trying is ME.software.value = Me.town.column(1) in the > > after update of the town combo box and I have also tried it in the software > > text box? I can’t get it to work properly. Am I forgetting something? I have > > the town combo box set to column count 2, widths 1â€;0â€, bound column 1. > >
|
|
There is a pretty good shareware utility named "Find and Replace" from Rick Fisher at Rickworld.com. Using it you can work your way through your elements and name them to conform to some naming convention. Start working with a copy of your application.
John Vinson provided a list of links to such utilities in a recent post.
HTH -- -Larry- --
"Jeremy Corson" <JeremyCorson[ at ]discussions.microsoft.com> wrote in message news:0AD5014B-2154-446B-83D1-31F7E6F61ACE[ at ]microsoft.com...
[Quoted Text] > Sprinks, > Thank you. After i got into learn this program i was reading this
technique > of useing tblCall, and other prefixes. Now i wish i had used them but now the > database is much larger and would take me a large amont of time to convert > it over to use these prefixes. Any suggestions to correct all of this? As for > the me command, i can take that out and use "forms" correct? > > I changed it to Forms![call log]![software]!value = forms![call > log]![town]!column(1) and it return an error saying " Run-time error '451': > Object not a collection. Because this is a Bound object i can not just set > the control source to that. Is there anything i can provide you with to help > drive an awnser? I'm even willing to upload an old verison of this DB some > where. > > > "Sprinks" wrote: > > > Jeremy, > > > > It's important to distinguish between *fields*, which are stored in tables, > > and form *controls* which display data on forms, and which may be Bound to a > > field in the form's underlying RecordSource, Bound to an expression, or be > > Unbound. > > > > To avoid referential ambiguity as well as obtain other benefits, most > > developers name their controls something other than the field they display, > > normally the field name with a 3-character prefix that identifies the control > > type, e.g., cboTown, txtSoftware. > > > > I suspect that this is what's causing the problem when you try to set the > > value in the AfterUpdate event. > > > > By the way, strictly speaking, you should use the Bang (!) operator with Me > > since the your control is part of the form's Controls collection, however, > > the dot (.) operator will work if there is no referential ambiguity. In an > > expression assigned to a Control Source, Me has no meaning, and is not > > necessary. > > > > So, assuming the Town combo box is named cboTown, set the ControlSource of > > the textbox to display the Software field as: > > > > =cboTown.Column(1) > > > > Sprinks > > > > "Jeremy Corson" wrote: > > > > > I have 4 fields on a form that are as follows: [Callers > > > name],[town],[software], and [comments]. I have two tables involved in my > > > problem: [Call log] and [town]. What I'm look to accomplish is that when I > > > select a town in the combo box of the form, it will update the software > > > field. Now the town table has two columns: [Towns] and [Software]. For an > > > example, when I select a Concord for my town field of my form, it will add > > > the second column to the software field. Any suggestions? > > > > > > What I'm currently trying is ME.software.value = Me.town.column(1) in the > > > after update of the town combo box and I have also tried it in the software > > > text box? I can't get it to work properly. Am I forgetting something? I have > > > the town combo box set to column count 2, widths 1";0", bound column 1. > > >
|
|
Jeremy,
In general, the Bang operator separates an object from members of a collection, and the dot operator separates an object from its methods and properties. Value and Column are properties, so the syntax should be
Forms![call log]![software].value = Forms![call log]![town].column(1)
However, if the value of software is determined unambiguously by the town, you are breaking normalization rules to store it redundantly in the form's RecordSource. If you need the value for a report, you can and should get it via a query.
The following references cover normalization in detail:
ACC: Database Normalization Basics http://support.microsoft.com/?id=100139 http://support.microsoft.com/?id=209534 http://support.microsoft.com/?id=283878
Database Normalization Tips by Luke Chung http://www.fmsinc.com/tpapers/genaccess/databasenorm.html
Support WebCast: Database Normalization Basics
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc060600/wcblurb060600.asp
Database Normalization: http://burks.bton.ac.uk/burks/foldoc/35/28.htm
5 Rules of Database Normalization: http://www.datamodel.org/NormalizationRules.html
"Understanding Relational Database Design" Document Available in Download Center: http://support.microsoft.com/?id=283698 http://support.microsoft.com/?id=164172
ACC2000: "Understanding Relational Database Design" http://support.microsoft.com/?id=234208
Fundamentals of Relational Database Design: http://support.microsoft.com/?id=129519
Database Deisgn Principles: http://msdn.microsoft.com/library/en-us/dndbdes/html/ch04DDP.asp
Sprinks
"Jeremy Corson" wrote:
[Quoted Text] > Sprinks, > Thank you. After i got into learn this program i was reading this technique > of useing tblCall, and other prefixes. Now i wish i had used them but now the > database is much larger and would take me a large amont of time to convert > it over to use these prefixes. Any suggestions to correct all of this? As for > the me command, i can take that out and use "forms" correct? > > I changed it to Forms![call log]![software]!value = forms![call > log]![town]!column(1) and it return an error saying " Run-time error '451': > Object not a collection. Because this is a Bound object i can not just set > the control source to that. Is there anything i can provide you with to help > drive an awnser? I'm even willing to upload an old verison of this DB some > where. > > > "Sprinks" wrote: > > > Jeremy, > > > > It's important to distinguish between *fields*, which are stored in tables, > > and form *controls* which display data on forms, and which may be Bound to a > > field in the form's underlying RecordSource, Bound to an expression, or be > > Unbound. > > > > To avoid referential ambiguity as well as obtain other benefits, most > > developers name their controls something other than the field they display, > > normally the field name with a 3-character prefix that identifies the control > > type, e.g., cboTown, txtSoftware. > > > > I suspect that this is what's causing the problem when you try to set the > > value in the AfterUpdate event. > > > > By the way, strictly speaking, you should use the Bang (!) operator with Me > > since the your control is part of the form's Controls collection, however, > > the dot (.) operator will work if there is no referential ambiguity. In an > > expression assigned to a Control Source, Me has no meaning, and is not > > necessary. > > > > So, assuming the Town combo box is named cboTown, set the ControlSource of > > the textbox to display the Software field as: > > > > =cboTown.Column(1) > > > > Sprinks > > > > "Jeremy Corson" wrote: > > > > > I have 4 fields on a form that are as follows: [Callers > > > name],[town],[software], and [comments]. I have two tables involved in my > > > problem: [Call log] and [town]. What I’m look to accomplish is that when I > > > select a town in the combo box of the form, it will update the software > > > field. Now the town table has two columns: [Towns] and [Software]. For an > > > example, when I select a Concord for my town field of my form, it will add > > > the second column to the software field. Any suggestions? > > > > > > What I’m currently trying is ME.software.value = Me.town.column(1) in the > > > after update of the town combo box and I have also tried it in the software > > > text box? I can’t get it to work properly. Am I forgetting something? I have > > > the town combo box set to column count 2, widths 1â€;0â€, bound column 1. > > >
|
|
Thank you guys so much! I will go though and change all the tables and field to use a standard naming conventions. I must wait til after monday cause this database is going "live" to all users on monday. So the key would be to finding an alternative way of acomplishing this task before friday at 4:15. Can we same the [software] in collum 2 of the town table as a string and recall it value as the default value of the sofware feild?
"Jeremy Corson" wrote:
[Quoted Text] > I have 4 fields on a form that are as follows: [Callers > name],[town],[software], and [comments]. I have two tables involved in my > problem: [Call log] and [town]. What I’m look to accomplish is that when I > select a town in the combo box of the form, it will update the software > field. Now the town table has two columns: [Towns] and [Software]. For an > example, when I select a Concord for my town field of my form, it will add > the second column to the software field. Any suggestions? > > What I’m currently trying is ME.software.value = Me.town.column(1) in the > after update of the town combo box and I have also tried it in the software > text box? I can’t get it to work properly. Am I forgetting something? I have > the town combo box set to column count 2, widths 1â€;0â€, bound column 1. >
|
|
I'm not sure exactly what you're asking.
I looked back to your last previous post and question the syntax. ME.software.value = Me.town.column(1)
you might try the Bang (!) operator instead.
ME!txtSoftware = Me!tcboTown.column(1)
be sure that the control on the form doesn't have the same name as the field that is its recordsource.
If that doesn't help and your material isn't confidential, zip up your application and attach it to an email to me ASAP. Maybe we can get you going before deadline.
Are you talking about Concord, MA? I used to live to the North of you. Of course if it's Concord, NH then I used to live to the South of you. Now I'm in the High Desert of Southern California.
HTH -- -Larry- --
"Jeremy Corson" <JeremyCorson[ at ]discussions.microsoft.com> wrote in message news:A359251E-5187-456B-82B9-09DA9A2AF75B[ at ]microsoft.com...
[Quoted Text] > Thank you guys so much! I will go though and change all the tables
and field > to use a standard naming conventions. I must wait til after monday cause this > database is going "live" to all users on monday. So the key would be to > finding an alternative way of acomplishing this task before friday at 4:15. > Can we same the [software] in collum 2 of the town table as a string and > recall it value as the default value of the sofware feild? > > "Jeremy Corson" wrote: > > > I have 4 fields on a form that are as follows: [Callers > > name],[town],[software], and [comments]. I have two tables involved in my > > problem: [Call log] and [town]. What I'm look to accomplish is that when I > > select a town in the combo box of the form, it will update the software > > field. Now the town table has two columns: [Towns] and [Software]. For an > > example, when I select a Concord for my town field of my form, it will add > > the second column to the software field. Any suggestions? > > > > What I'm currently trying is ME.software.value = Me.town.column(1) in the > > after update of the town combo box and I have also tried it in the software > > text box? I can't get it to work properly. Am I forgetting something? I have > > the town combo box set to column count 2, widths 1";0", bound column 1. > >
|
|
Hey larry, I do live in Concord New Hampshire! How cool is that! I do have it currently uploaded at www.gradientventures.com/download The file in there is OLD but has the same basic set up. I can go home and up load it at its current state when i get home from work 4:30 concord time. The DB is now in a front end and back end. you can just Dellet out the tables in the front end and relink them to the back end. My personel e-mail is Jeremy_corson[ at ]hotmail.com. E-mail me and i'll give you my phone number. if your willing, of course. I'm extremely interested in fixing this
"Larry Daugherty" wrote:
[Quoted Text] > I'm not sure exactly what you're asking. > > I looked back to your last previous post and question the syntax. > ME.software.value = Me.town.column(1) > > you might try the Bang (!) operator instead. > > ME!txtSoftware = Me!tcboTown.column(1) > > be sure that the control on the form doesn't have the same name as the > field that is its recordsource. > > If that doesn't help and your material isn't confidential, zip up your > application and attach it to an email to me ASAP. Maybe we can get > you going before deadline. > > Are you talking about Concord, MA? I used to live to the North of > you. Of course if it's Concord, NH then I used to live to the South > of you. Now I'm in the High Desert of Southern California. > > HTH > -- > -Larry- > -- > > "Jeremy Corson" <JeremyCorson[ at ]discussions.microsoft.com> wrote in > message news:A359251E-5187-456B-82B9-09DA9A2AF75B[ at ]microsoft.com... > > Thank you guys so much! I will go though and change all the tables > and field > > to use a standard naming conventions. I must wait til after monday > cause this > > database is going "live" to all users on monday. So the key would be > to > > finding an alternative way of acomplishing this task before friday > at 4:15. > > Can we same the [software] in collum 2 of the town table as a string > and > > recall it value as the default value of the sofware feild? > > > > "Jeremy Corson" wrote: > > > > > I have 4 fields on a form that are as follows: [Callers > > > name],[town],[software], and [comments]. I have two tables > involved in my > > > problem: [Call log] and [town]. What I'm look to accomplish is > that when I > > > select a town in the combo box of the form, it will update the > software > > > field. Now the town table has two columns: [Towns] and [Software]. > For an > > > example, when I select a Concord for my town field of my form, it > will add > > > the second column to the software field. Any suggestions? > > > > > > What I'm currently trying is ME.software.value = Me.town.column(1) > in the > > > after update of the town combo box and I have also tried it in the > software > > > text box? I can't get it to work properly. Am I forgetting > something? I have > > > the town combo box set to column count 2, widths 1";0", bound > column 1. > > > > > >
|
|
|