zpetersen
asked on
Help - Update split form using text box, combo box, and button
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.MigrationTec h, MigrationData.TargetDate, MigrationData.UserDom, MigrationData.MachineDom, MigrationData.AdminRights, MigrationData.TargetOU, MigrationData.AssetID, MigrationData.UserStatus, MigrationData.ComputerStat us, MigrationData.CompleteDate , MigrationData.Comments, MigrationData.LastName, MigrationData.FirstName, MigrationData.Shift, MigrationData.Telephone, MigrationData.Email, MigrationData.Combined, MigrationData.State, MigrationData.City, MigrationData.Department
FROM MigrationData
WHERE (((MigrationData.Migration Tech)=[For ms]![Migra tionTracke r]![cbxTec h]) AND ((MigrationData.TargetDate )=[Forms]! [Migration Tracker]![ 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.
Thanks!! :)
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.MigrationTec
FROM MigrationData
WHERE (((MigrationData.Migration
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.
Thanks!! :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both worked. Thanks to Harfang for the full solution.
hey... i posted my answer from my car on my iphone.... i think a little understanding is in order for my not copying your full filter...:P
j/k
j/k
me.filter = "XYZ"
me.filteron = true
Of course, you should put your criteria in for XYZ...8)