Thread: Database For Training Records
09-25-09, 13:23 #1Registered User
- Join Date
- Sep 2009
Unanswered: Database For Training Records
Hi, am creating a database for training records and i need help with the following:
1. Query the database to search by the following criteria: Search by name, Search by dept, Search by course title and search by course date. I am able to design only specific queries like query for courses attended by a particular person and adding the name in the query design. But what i really need is this e.g. if i want to see courses attended by a particular person, i want the query to ask me for the name of the person 1st before displaying the record.
2. I have 2 seperate tables for staff list and training data. What i want is that when i input the staff number in the training data, other information about the staff is updated in the training table e.g dept etc. So that i do not have to update the information manually in the traiing table.
09-26-09, 01:34 #2Moderator
- Join Date
- Dec 2004
- Madison, WI
1. To design a query to search by a name which is entered by a prompt, under the person's name column in the query designer, add in criteria such as: Like [Enter Person's Name] & *
For criteria off of a form: Like Forms!MySearchForm!MyPersonsNameSearchField & *
2. There's a couple different approaches. One approach is to design a query to update information in the appropriate table (again, using criteria where the ID field =Forms!MyDataEntryForm!IDField.) You run that query (ie. docmd.openquery "MyUpdateQueryName") in vba code on the field events such as the AfterUpdate event for those fields where the data is updated and you want to update info in another table. Another method is to write vba code to open the table you need to update as a recordset and populate the data for the appropiate fields. You can also utilize expressions in vba code or in a query such as "Dlookup" to look up values in a table and populate them into another table. See help on utilizing the Dlookup expression.
Last edited by pkstormy; 09-26-09 at 01:40.Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)