Re: Combo Box AfterUpdate Help



BTW a good way out of this is to tell me that the fields form a
Compound/Composite Primary Key and you need to create a Compound/Composite
Foreign Key in the related table, that would be OK.

Although no doubt someone will interject here with the hallowed AutoNumber
(vbg) as Surrogate.

--
Slainte

Craig Alexander Morrison
Crawbridge Data (Scotland) Limited

"Harry Thomas" <HarryThomas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DB41B807-8F0B-4B03-ACE4-5E54C1C31A2C@xxxxxxxxxxxxxxxx
>I asked a question and expected a reasonable answer, if I wanted a lecture
>on
> database design I would have asked for that instead. You have no idea of
> the
> design, the examples I gave yesterday and today were purely to get an
> answer
> to a question. So unless you want to make an arse of yourself, read the
> question.
>
> "Craig Alexander Morrison" wrote:
>
>> Dodgy design as already pointed out in "Updating....." thread yesterday.
>>
>> I think you will find most people will consider your design flawed.
>>
>> Anyway use the Column property of the ComboBox as already stated
>> yesterday.
>>
>> I am hesitant to help you make an arse out of your database however in
>> the
>> AfterUpdate event procedure of the ComboBox do something like this:
>>
>> Me!FieldB4 = Me!cboFieldA1.Column(1)
>>
>> This assumes that cboFieldA1 is bound to FieldA1 and that FieldA3 is the
>> next column.
>>
>> In this case with the correct design you would not need any code if the
>> value of FieldA1 was the primary key of the table being referenced and
>> FieldB4 was the foreign key in the related table.
>>
>> I speak from 25 years of experience with Relational Databases and nearly
>> 15
>> with Access/Jet.
>>
>> I would strongly recommend you redesign your database conforming to the
>> relational model rather than the big buckets of merde approach.
>>
>> This last sentence is the one that is of most help to you although you
>> may
>> not realise it.
>>
>>
>> --
>> Slainte
>>
>> Craig Alexander Morrison
>> Crawbridge Data (Scotland) Limited
>>
>> "Harry Thomas" <HarryThomas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:1A035E32-DF85-442B-8D24-9EA87A84E34A@xxxxxxxxxxxxxxxx
>> >I have two tables, TableA and TableB. In a form I use a combo Box to
>> >select
>> > data from Field1 in TableA and place it in Field2 in TableB. What is
>> > the
>> > exact command I put in the AfterUpdate field of the combo box to also
>> > take
>> > data from Field3 of TableA and place it in Field4 of TableB.
>> >
>> > Thank you
>>
>>
>>
>>
>>


.



Relevant Pages

  • Re: Dynamic column specification in table update
    ... Pro SQL Server 2000 Database Design - ... > primary key should be made up from your data. ... >> The only excuses tend to fall along the lines of laziness or ignorance. ...
    (microsoft.public.sqlserver.programming)
  • Re: Key Violations in Append Queries
    ... Normally, if a primary key or other unique index is created, it is ... the design of the database requires uniqueness for the key involved. ... Whoever designed the database supposedly felt this was necessary. ... It may be that you should just omit this from the append query, ...
    (microsoft.public.access.queries)
  • Re: M:M/Multiple Keys
    ... the SyncService - you'll see that things like the value of a primary key is ... keys is that while your design become deeper and deeper, ... database itself but in the interface as well. ... I stopped using composite keys many years ago and since then, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Key Violations in Append Queries
    ... Normally, if a primary key or other unique index is created, it is because ... the design of the database requires uniqueness for the key involved. ... Whoever designed the database supposedly felt this was necessary. ...
    (microsoft.public.access.queries)
  • Re: Stupid Database Tricks
    ... if you build a database with one of the ... Also, if you design your own database and create your own tables, there ... that you haven't assigned a primary key, and that one is recommended, and ... be better for the newbie DBD to discover a natural key, and declare that, ...
    (comp.databases.theory)