Re: combox update other table
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 09/27/04
- Next message: Allen Browne: "Re: Enable command button if no null entries in form"
- Previous message: Rick: "Main Form Focus with Sub Forms"
- In reply to: mark r: "Re: combox update other table"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Allen Browne: "Re: Enable command button if no null entries in form"
- Previous message: Rick: "Main Form Focus with Sub Forms"
- In reply to: mark r: "Re: combox update other table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|