Help - Update split form using text box, combo box, and button
Posted on 2007-08-02
Note: I'm using Access 2007.
I have a database with one table containing a bunch of data that was moved over from a spreadsheet. I have one form (split form) that shows the data from the table. Currently the record source for the form is simply the table.
When the form is opened I want to display all of the data from the table, however, each person using the form will need to filter the data based on their name and the date. I have added a text box for the date and a combo box for their name.
Form = migrationtracker
Text box = txtDate
Combo box = cbxTech
I have also added a button that I want to execute the filter command.
Button = btnUpdate
So basically what I want to do is update the form record source to be a query that is filtered by the Tech name and the date. I figured it would be something like this:
SELECT MigrationData.ID, MigrationData.UserID, MigrationData.AcctType, MigrationData.AcctNumber, MigrationData.MigrationTech, MigrationData.TargetDate, MigrationData.UserDom, MigrationData.MachineDom, MigrationData.AdminRights, MigrationData.TargetOU, MigrationData.AssetID, MigrationData.UserStatus, MigrationData.ComputerStatus, MigrationData.CompleteDate, MigrationData.Comments, MigrationData.LastName, MigrationData.FirstName, MigrationData.Shift, MigrationData.Telephone, MigrationData.Email, MigrationData.Combined, MigrationData.State, MigrationData.City, MigrationData.Department
WHERE (((MigrationData.MigrationTech)=[Forms]![MigrationTracker]![cbxTech]) AND ((MigrationData.TargetDate)=[Forms]![MigrationTracker]![txtDate]));
It's been a while since I have done something like this and for some reason I'm just not getting it right. Any help would be much appreciated.