G
Guest
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
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