A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open another form based on the same records as in the first form



 
 
Thread Tools Display Modes
  #1  
Old September 30th, 2004, 09:39 AM
Anders Berlin
external usenet poster
 
Posts: n/a
Default 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  
Old October 1st, 2004, 12:40 AM
John
external usenet poster
 
Posts: n/a
Default


"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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 01:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.