Re: combox update other table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 09/27/04


Date: Mon, 27 Sep 2004 23:01:04 +0800

Sorry, Mark. I can't make sense of that question.
Hopefully someone else can.

Presumably it involves executing some kind of Update query statement to
update some record in some other table.

-- 
"mark r" <anonymous@discussions.microsoft.com> wrote in message
news:1f1c01c4a49f$d8072a00$a501280a@phx.gbl...
> you misunderstood my question and answered the question
> you thought I was asking.
>
> I don't need to add to any list. My list is fine as is. I
> am trying to get one combobox to update two different
> fields in two different tables:
>
>
>>> Form1 for table1 has a combobox with a table lookup. If
> the user selects a
>>> value, it is placed in field1 of table1.........but I
> also want that data
>>> stored in field2 of table2...............I know this
> sounds redundant, but
>>> never mind that.
>>>
>>> 1.  Would I use AFTERUPDATE?
>>> 2.  Would I use a FOR loop?
>>>
>>> I am guessing at the code:
>>> for each record in redundanttable2
>>>    if redundanttable2.id = table1.id then
>>>       if me.field1 = "category 1"  or  "category 2" then
>>>              set redundanttable2.filed2 = me.field1
>>>       else  if    ISNULL(me.field1) then       ' the
> user may have made
>>> the
>>> combox
>>> '
>      NULL using
>>> the
>>> delete key
>>>              set redundanttable2.filed2 to be null also
>>>          else  set redundanttable2.filed2 = "OTHER
> category"
>>>
>>>   exit for
>>>   end if
>>> next
>>>
>>> end sub
>>
>>
>
>
>
>
>>-----Original Message-----
>>If the combo's bound column is not zero width, you can
> use the NotInList
>>event to add the new data to the look up table as well.
> Example at:
>>    NotInList: Adding values to lookup tables
>>at:
>>    http://members.iinet.net.au/~allenbrowne/ser-27.html
>>
>>If the bound column is not what you display in the combo,
> use its DblClick
>>event to open a form into the lookup table so the user
> can add the details
>>of the record there. Then in the AfterUpdate and
> AfterDelConfirm events of
>>that form, Requery the combo on the original form so it
> gets to hear about
>>the changes.
>>
>>-- 
>>Allen Browne - Microsoft MVP.  Perth, Western Australia.
>>Tips for Access users - http://allenbrowne.com/tips.html
>>Reply to group, rather than allenbrowne at mvps dot org.
>>
>>"mark r" <markr@discussions.microsoft.com> wrote in
> message
>>news:2F3A43A7-7789-48B8-9627-F8CB01BF4800@microsoft.com...
>>> Form1 for table1 has a combobox with a table lookup. If
> the user selects a
>>> value, it is placed in field1 of table1.........but I
> also want that data
>>> stored in field2 of table2...............I know this
> sounds redundant, but
>>> never mind that.
>>>
>>> 1.  Would I use AFTERUPDATE?
>>> 2.  Would I use a FOR loop?
>>>
>>> I am guessing at the code:
>>> for each record in redundanttable2
>>>    if redundanttable2.id = table1.id then
>>>       if me.field1 = "category 1"  or  "category 2" then
>>>              set redundanttable2.filed2 = me.field1
>>>       else  if    ISNULL(me.field1) then       ' the
> user may have made
>>> the
>>> combox
>>> '
>      NULL using
>>> the
>>> delete key
>>>              set redundanttable2.filed2 to be null also
>>>          else  set redundanttable2.filed2 = "OTHER
> category"
>>>
>>>   exit for
>>>   end if
>>> next
>>>
>>> end sub 


Relevant Pages

  • Re: combox update other table
    ... Would I use AFTERUPDATE? ... >event to open a form into the lookup table so the user ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.formscoding)
  • Re: OT; Attack planned on Fort Dix
    ... New Feature: Mark All As Read! ... These were especially stupid Muslims (redundant). ... to a business to to have a copy of a Video transferred to DVD and it ...
    (rec.gambling.poker)
  • Re: site critique - email user
    ... start degrading enough to be noticed after you reach the couple of ... hundred mark or so if you are just searching initially for 'does ... sites the technique avoids a lookup in a directory of 65536 files using ...
    (uk.net.web.authoring)
  • Re: routing by destination port
    ... gates and choose this gates by destination port? ... -j MARK -set-mark 0x1 ... ip rule add fwmark 0x1 lookup 1 ...
    (comp.os.linux.networking)
  • Re: Allocating Dates
    ... Mark, you may be able to do this without a table, just using: ... If you want to use a lookup table of dates, you are best to store only the first date in the period, and then use this kind of logic to figure out the ending date and consequently the period that any particular date belongs to: ... Perth, Western Australia ... In my mind it would be taking the remaning days from starting date to the end of the first week, then allocating the dates for the remaining weeks based on the number of days remaining. ...
    (microsoft.public.access.forms)