RandomUser
New member
- Local time
- Yesterday, 19:25
- Joined
- Oct 19, 2019
- Messages
- 7
First of all, I'd like to let you know I am an absolute newbie at coding and I'm trying to write some of my first coding for an Access program I put together.
I'm trying to implement rules for specifics fields in the input screen. The fields are used while I conduct a survey. I'd like to eliminate the possibility of errors by making sure specific fields do not contradict each other.
To be specific, if a valve is not able to be located, it cannot be exercised.
I'm trying to write a code requiring one drop down box to auto-populate another drop down box when a specific option is chosen.
If a valve is not located, I want the option under "Exercised" to be "No"
I went into the input design and clicked on the "NOTES" field>property sheet, data>event>after update>click on three dots>code builder>click OK
If [NOTES] = "UNABLE TO LOCATE VALVE" Then
Me.[EXERCISED] = NO
End If
End Sub
I get an error "External Name not defined"
If I put Me. in front of [NOTES], I receive an error, "Invalid use of Me Keyword"
I have other fields to build rules into and if I can figure this one out, I should be able to apply the same logic to the other fields.

I put in the code I believe is correct (based on help I've received elsewhere), and I've hit a dead end.
I'm trying to implement rules for specifics fields in the input screen. The fields are used while I conduct a survey. I'd like to eliminate the possibility of errors by making sure specific fields do not contradict each other.
To be specific, if a valve is not able to be located, it cannot be exercised.
I'm trying to write a code requiring one drop down box to auto-populate another drop down box when a specific option is chosen.
If a valve is not located, I want the option under "Exercised" to be "No"
I went into the input design and clicked on the "NOTES" field>property sheet, data>event>after update>click on three dots>code builder>click OK
If [NOTES] = "UNABLE TO LOCATE VALVE" Then
Me.[EXERCISED] = NO
End If
End Sub
I get an error "External Name not defined"
If I put Me. in front of [NOTES], I receive an error, "Invalid use of Me Keyword"
I have other fields to build rules into and if I can figure this one out, I should be able to apply the same logic to the other fields.

I put in the code I believe is correct (based on help I've received elsewhere), and I've hit a dead end.