MS ACCESS 97 -Need to get Fields to Auto-populate

By Mark.X.McFarland ·
Hello, I have created a Access database that include employees information. I have created a table with all the information such as: name, telephone # supervrs name, location etc.

I have also created a Form with these fields. However, I need to have the fields to auto-populate when I put in the name of the employee in the employee names field. Help!!!!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Collapse -


by john.a.wills In reply to MS ACCESS 97 -Need to get ...

Write a VBA event to recognize leaving the name control (or clicking a button). What follows is for a slightly different purpose, but should be a suitable model.
Private Sub Possession_Click()
On Error GoTo Err_Possession_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Possession"
stLinkCriteria = "1=1"
If IsNull(Me.Username) _
stLinkCriteria = stLinkCriteria & " and [UserName] like '" & Me.Username & "*'"
End If
If IsNull(Me.Model) _
stLinkCriteria = stLinkCriteria & " and [Model] like '" & Me.Model & "*'"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit Sub

MsgBox Err.Description
Resume Exit_Possession_Click

End Sub

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums