I have to thank you guys right off the bat. I have been searching for a way to fill one field based on the value of another and found that answer here. So, I decided to join in. This is that best source of information I have found for Access. Many pats on that back to the founders!
Now then, I used Dlookup to automatically fill a text field based on a selection I make in an option group. What I would like to happen is the data show up when I select the option, instead of updating when moving to the next record. Here is what I have to this point and it works great to populate my Finding field after I move to the next record. I put this in the "On Current" event of the form property.
If Me!ComplianceLevel = 2 Then
Me!Finding = DLookup("NoneFinding", "tblCAPProtocolQuestions", _
"[CAPID]=[forms]![frmFindingsEntry].[CAPID]")
ElseIf Me!ComplianceLevel = 3 Then
Me!Finding = DLookup("PartialFinding", "tblCAPProtocolQuestions", _
"[CAPID]=[forms]![frmFindingsEntry].[CAPID]")
Else
Me!Finding = Null
End If
If I choose one compliance level, I get a finding and another compliance level gives me a different finding. I would like to update the field when the selection is made so I can enter some comments about the finding. Also, should I improve what I have so far? Thanks.
Now then, I used Dlookup to automatically fill a text field based on a selection I make in an option group. What I would like to happen is the data show up when I select the option, instead of updating when moving to the next record. Here is what I have to this point and it works great to populate my Finding field after I move to the next record. I put this in the "On Current" event of the form property.
If Me!ComplianceLevel = 2 Then
Me!Finding = DLookup("NoneFinding", "tblCAPProtocolQuestions", _
"[CAPID]=[forms]![frmFindingsEntry].[CAPID]")
ElseIf Me!ComplianceLevel = 3 Then
Me!Finding = DLookup("PartialFinding", "tblCAPProtocolQuestions", _
"[CAPID]=[forms]![frmFindingsEntry].[CAPID]")
Else
Me!Finding = Null
End If
If I choose one compliance level, I get a finding and another compliance level gives me a different finding. I would like to update the field when the selection is made so I can enter some comments about the finding. Also, should I improve what I have so far? Thanks.