If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Open another form based on the same records as in the first form
I have a form (Machine) that displays records from a table. When clicking a
command button, it opens another form (MachineList), and I want it to use the same filter as I may have in the first form (Machine). I have tried the following (in the OnOpen event of the MachineList form): Me.Filter = Forms("Machine").Filter If Forms("Machine").FilterOn = True Then Me.FilterOn = True Problem is that the form Machine includes Combo boxes, and if I use the filter on those, The MachineList form prompts me for the value of a field (for instance Lookup_Make.Name). So what I really would like to do is open the form MachineList based on the records currently filtered in Machine - only specified by the primary index-field: "MachineID" - because this field is the same for both forms. So if I use a filter in the Machine form, which result in three records with the MachineID values of 1080047, 1080048 and 1080049, I would like the MachineList form to use the following filter: [MachineID] = 1080047 OR 1080048 or 1080049. It sounds simple, but how do I do? |
#2
|
|||
|
|||
"Anders Berlin" wrote in message ... I have a form (Machine) that displays records from a table. When clicking a command button, it opens another form (MachineList), and I want it to use the same filter as I may have in the first form (Machine). I have tried the following (in the OnOpen event of the MachineList form): Me.Filter = Forms("Machine").Filter If Forms("Machine").FilterOn = True Then Me.FilterOn = True Problem is that the form Machine includes Combo boxes, and if I use the filter on those, The MachineList form prompts me for the value of a field (for instance Lookup_Make.Name). So what I really would like to do is open the form MachineList based on the records currently filtered in Machine - only specified by the primary index-field: "MachineID" - because this field is the same for both forms. So if I use a filter in the Machine form, which result in three records with the MachineID values of 1080047, 1080048 and 1080049, I would like the MachineList form to use the following filter: [MachineID] = 1080047 OR 1080048 or 1080049. It sounds simple, but how do I do? Is the relationship between the tables set up properly. If machine list has many records for each instance of Machine then you'll have to set up a one to many relationship, which means they cannot use the same primary key. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange stLinkCriteria behaviour on command button | Anthony Dowd | Using Forms | 3 | August 21st, 2004 03:01 AM |
Searching Records | Melissa Lambino | New Users | 6 | July 20th, 2004 04:51 AM |
Form won't open - intermittent problem | Nikos Yannacopoulos | General Discussion | 1 | July 8th, 2004 01:11 PM |
matching multiple forms on open to form records | EdwardA | Using Forms | 0 | June 10th, 2004 06:38 PM |
Form Doesn't Go To New Record | Steve | New Users | 15 | May 16th, 2004 04:33 PM |