Automatically inputting results

  • Thread starter Thread starter jv
  • Start date Start date
J

jv

Hey I was hoping to find some help with a problem I'm having. I've created
a database in Access 2003 to input results that were gathered from surveys
that have been collected and want to be able to have several fields have a
"null" result based on the answer to a "yes/no" question in a previous field.
For example if the result for a question about fertilizer use is a no, all
the other fertilizer related questions such as concentration, annual
frequency ect. would be automatically inputed with a null result to save time
and not mess up the results. Any help would be greatly apreciated. Thanks in
advance.
 
The fields already are null if you don't enter anything into them. As long
as the field is set in the table to allow null, you're good to go. However
maybe what you are requesting is to skip those fields on the form. If that
is the case put this in the after update event of the yes/no field on the
form. But if you've entered information into those fields you will need to
set back to null if that is what you want


if me.[fertilizerYesNoField] = no then
me.[setRelatedFieldToNull] = "" '[or NULL] sets the field to null
me.[nextFieldToGoTo].setfocus 'skips to next control for data entry
end if

replace fertilizerYesNoField] with the name of the control for your boolean
field
replace setRelatedFieldToNull with the control you want to set to null use
NULL for numeric and "" for string data
replace nextFieldToGoTo with the name of the control of the next field for
data entry after the ones related to the yes/no that you wish to skip.
 
TYPO: if me.[fertilizerYesNoField] = FALSE then

SuzyQ said:
The fields already are null if you don't enter anything into them. As long
as the field is set in the table to allow null, you're good to go. However
maybe what you are requesting is to skip those fields on the form. If that
is the case put this in the after update event of the yes/no field on the
form. But if you've entered information into those fields you will need to
set back to null if that is what you want


if me.[fertilizerYesNoField] = no then
me.[setRelatedFieldToNull] = "" '[or NULL] sets the field to null
me.[nextFieldToGoTo].setfocus 'skips to next control for data entry
end if

replace fertilizerYesNoField] with the name of the control for your boolean
field
replace setRelatedFieldToNull with the control you want to set to null use
NULL for numeric and "" for string data
replace nextFieldToGoTo with the name of the control of the next field for
data entry after the ones related to the yes/no that you wish to skip.

jv said:
Hey I was hoping to find some help with a problem I'm having. I've created
a database in Access 2003 to input results that were gathered from surveys
that have been collected and want to be able to have several fields have a
"null" result based on the answer to a "yes/no" question in a previous field.
For example if the result for a question about fertilizer use is a no, all
the other fertilizer related questions such as concentration, annual
frequency ect. would be automatically inputed with a null result to save time
and not mess up the results. Any help would be greatly apreciated. Thanks in
advance.
 
Back
Top