Link to home
Start Free TrialLog in
Avatar of zpetersen
zpetersenFlag for United States of America

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.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
FROM MigrationData
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.

Thanks!! :)
Avatar of kaosyeti
kaosyeti

try using

me.filter = "XYZ"
me.filteron = true

Of course, you should put your criteria in for XYZ...8)
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zpetersen

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