This is my first stab at a relational database and it works (I don't know the most efficient way to do things and wouldn't have gotten this far without google) but the user has asked for some tweaks.
I created an Employee database that is used for general employee information, keeping track of employee evaluation dates, and uniform inventory (uniform stock in, uniforms issued to employee). What currently has me stumped (maybe a mental block) is, I have a form for UniformsOut, which fills in the UniformsOut Table from the white background fields. The gray background fields are for user convenience. See below.
The EmployeeID combo box when dropped down shows the EmployeeID, LastName and FirstName in 3 columns (from the EmployeeInfo table).
By user request I'd like to use the Find button to search the last name (typing in the first few letters) from the EmployeeInfo table and when a selection from the filtered list is made have it drop the EmployeeID in its linked field on this form.
Questions showing my lack of knowledge:
If a database is open are the tables in that database open even if there not on screen?
If not, does the EmployeeID table have to be open to search it?
If not, how does DLookup do it?
If there is a better way to do things, I'm open to any suggestions.
Thanks,
renigar
Here is the start of some code:
I created an Employee database that is used for general employee information, keeping track of employee evaluation dates, and uniform inventory (uniform stock in, uniforms issued to employee). What currently has me stumped (maybe a mental block) is, I have a form for UniformsOut, which fills in the UniformsOut Table from the white background fields. The gray background fields are for user convenience. See below.
The EmployeeID combo box when dropped down shows the EmployeeID, LastName and FirstName in 3 columns (from the EmployeeInfo table).
By user request I'd like to use the Find button to search the last name (typing in the first few letters) from the EmployeeInfo table and when a selection from the filtered list is made have it drop the EmployeeID in its linked field on this form.
Questions showing my lack of knowledge:
If a database is open are the tables in that database open even if there not on screen?
If not, does the EmployeeID table have to be open to search it?
If not, how does DLookup do it?
If there is a better way to do things, I'm open to any suggestions.
Thanks,
renigar
Here is the start of some code:
Code:
'VBA code'
Private Sub UniOutFindBtn_Click()
Dim strLN As String
Dim EmpID As Long
strLN = InputBox("Please Enter Last Name" & vbNewLine & "To Search For", "Last Name Search")
If strLN = "" Then Exit Sub
[EmployeeInfoT].Filter = "LastName Like ""*" & strLN & "*"""
[EmployeeInfoT].FilterOn = True
End Sub