Updated Values - 2 Controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

**Currently**

I'm using Access 2003. I have a form for keeping track of network problems
reported by employees. Every record is given a "Report" number. The "Report"
number is also the primary key. There are many other fields that hold details
for the problem, like the location, reporting employee, etc. I have a combo
box control named "Original" that is used for referencing the original
"Record" number when entering supplemental information. In my form,
"Original" has "Reports" as the row source and "Original" as the control
source.

So, in the table, if "Record" #20 and #21 were created to refer to "Record"
#19, then 20 and 21 would have "19" in the "Original" field.

**My Problem**

So, when you start a new record you are given a new "Record" number. If you
are entering information in reference to a previous record then I would like
the selection in "Original" to automatically fill in the previous details
(Like location, reporting employee, etc) from the original record into the
new one without changing information in the existing records.

Any Advice??? I hope that I made "some" sense...
 
Off-hand, there are two ways to do what you want:

1. If there isn't too much data being kept for each report, when you load
the combo box, make it a multi-column combo box with the columns containing
the other data. These other columns would be hidden (width = 0). In the
afterupdate event for the combo box (the combobox, not the form), load the
data from those columns into the appropriate fields on your form. Works
well if you don't have too many reports and don't have too many columns for
each report. Otherwise becomes very slow and hogs memory.

2. In the afterupdate event of the combobox, open a recordset on the table
with the data, do a seek or findfirst to the row with the appropriate
original report number, and load the data from that record into the fields
of the form.
 
Back
Top