T
Trey Shaffer
I have a form ( continuous form ) which is called with a filter to display
data for a particular key value, call it AnimalID.
This works fine for displaying existing data, but I would like to be able to
add a record from within the same form. As it is if I go to the new record
and attempt to save or exit, it fails because the AnimalID has not been
set..I do not want to display the AnimalID field in the detail section as an
input field. I want to be able to populate the value automatically with the
AnimalID value that controls the filter.
I thought of one approach trying to capture the AnimalID value from a
previous record and initialize that in the hidden AnimalID field in the new
record.
Also, I would like to be able to add a record, even if none already exist,
so somehow I need to capture the value of the filter that opens the form.
It is launched from another form with the following:
stLinkCriteria = "[AnimalID]=" & Me![AnimalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I would appreciate any help here. I'm not a strong Access coder...
I need to:
Identify a reference to the AnimalID value used for the filter.
Identify the right event to use to manipulate the AnimalID value in a
new record.
Generate the code to set the value of the AnimalID field in the new
record field, based on its being empty or null.
data for a particular key value, call it AnimalID.
This works fine for displaying existing data, but I would like to be able to
add a record from within the same form. As it is if I go to the new record
and attempt to save or exit, it fails because the AnimalID has not been
set..I do not want to display the AnimalID field in the detail section as an
input field. I want to be able to populate the value automatically with the
AnimalID value that controls the filter.
I thought of one approach trying to capture the AnimalID value from a
previous record and initialize that in the hidden AnimalID field in the new
record.
Also, I would like to be able to add a record, even if none already exist,
so somehow I need to capture the value of the filter that opens the form.
It is launched from another form with the following:
stLinkCriteria = "[AnimalID]=" & Me![AnimalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I would appreciate any help here. I'm not a strong Access coder...
I need to:
Identify a reference to the AnimalID value used for the filter.
Identify the right event to use to manipulate the AnimalID value in a
new record.
Generate the code to set the value of the AnimalID field in the new
record field, based on its being empty or null.