473,385 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Filter data from another form

2
I need help.

I am new to MS Access and have been assign this project.

I want to be able to filter data from a form that will be displayed on a subform.

I don't know if this is possible but ideally i would like to double click on a field from Form A which will open a subform and display filtered data based on the data's site code that was double clicked.

My database is for a budget tracker

finance data will be entered for different sites. I would like an option for users to be able to click on a field in a form that will open another form so they can edit data which has been filtered for that site.
Sep 19 '08 #1
5 2718
Echidna
53
Hi Mapi,

this all depends on the fields and the data held within them.

you can open a form selecting the Record you wish to alter:

Expand|Select|Wrap|Line Numbers
  1. docmd.OpenForm "<insert Formname>",<select windowmode>,<insert filter>
the filter will be a field containing data consistent with both forms ie a Primary Key or other (preferrably) indexed field.

ie "MyPK=" & me.<field you are double clicking>

hope this helps


Leon
Sep 19 '08 #2
Mapi
2
I managed to do the first part which is open another form on double click but i can't seem to figure out the filter part. Can you please provide more info on the filter part.

Thanks in advance
Sep 28 '08 #3
Echidna
53
Hiya,

I think i was a little ambiguous.

does the subform contain the same recordsource (table / query) as the main form?
if so, the filter (or where instruction) would be
"[PK]=" & me.<PK>

thus you are opening the form with the Primary Key of the record, this makes the margin for error a lot less than looking at data itself (unless you are certain it is unique accross the table(s)

Hope this clears it up a little bit

Leon
Sep 30 '08 #4
I need to use a command button to open and filter a child of a child form. As a filter it needs to use the PK of the main form and the PK of the first child form to filter and open the child of the child form. Both PK's are referenced in the query the the 1st child form is based on.

Basically, I just need to know if the filter "[PK]=" & me.<PK> can be modified to include two fields instead of one. Any ideas?
Oct 15 '08 #5
Echidna
53
hi,

you can filter a form on any number of criteria you choose as long as they exist within the recordsource, or within a Foreign Key Constraint.


Expand|Select|Wrap|Line Numbers
  1. "[PK]=" & me.(mainform)PK & "AND" & "[secondKey]=" & me.subfrm!secondKey

hope this helps

Leon
Oct 16 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
2
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
11
by: Bob | last post by:
I am in the process of upgrading an Access database to SQL Server (and climbing that learning curve!). The wizard happily upgraded all the tables and I can link to them OK using ODBC. The...
4
by: bgreer5050 | last post by:
I have a form with various fields with a double click event to bring up a filter via a query. Is it possible to goto another field and apply another filter only to the records that were found...
8
by: Abedin | last post by:
I have 9 digits in form of "111020402". Then I have another 9 digits in form of "111020403". I have 100,000 records of these two 9-digit numbers. I want to filter this as follows: District:...
5
by: Jim Mandala | last post by:
Using Access 2003 front end; SQL Server 2005 Back end: I have a complex form that has lots of data fields including about thirty or so checkboxes storing Yes/No data that I would like my users...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.