Using An Integer From A Subform To Filter A Report.

Aug 17, 2006

THis has to be an easy issue.

I have a subform that in the on curren event i passes the ClassId out to my main for in an unbound text box

Forms![Student]![ClassID] = Me![ClassID]

I know this part works

I then have a command button that should pass ClassID to a report so that it can be filtered. Here is the on_click code

Private Sub cmdReprintAccom_Click()
On Error GoTo Err_cmdReprintAccom_Click

Dim stDocName As String
Dim strReptCriteria As String

strReptCriteria = ClassID
stDocName = "Forms - Accomodations"
DoCmd.OpenReport stDocName, acViewPreview, , _
"[ClassID] = '" & strReptCriteria & "'"

My problem is that I keep getting a type mismatch error. I know that it is because CLassID is a number and it is getting passed as a string i just can't figure out the syntax to the highlighted code.

View Replies


ADVERTISEMENT

Reports :: Continuous Subform - Report Filter String

Nov 2, 2013

I have a command button as a field in a continuous subform which is based on a table. I click it and it opens a report. I need the report to be filtered by the ID of said record and not to show all the records.

View 3 Replies View Related

Filter A Report USING A Forms Filter Results

Oct 25, 2006

I am using MS Acess2000 and need to make a report that will be passed around with production work. My primary key is the invoice number of the work order. Currently to open an invoice i have a macro, attached to a query with the following qualifiers; Like [Enter invoice]

This pulls up the current record fine.
for the form and flags the folloing in the property filter sectin of the form

(((([CustomerTableMasterRef].[Invoice]) Like [Enter invoice])))

PART 2

Now I am trying to use microsofts how to filter a report using a forms filter...
This picks up on the Invoice query as shown above but does not just insert the query results...

Is there better code or another way to approach this... Currently i am using:

Name:cmdOpenReport
Caption: Open Report
OnClick: [Event Procedure]

Private Sub CmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Open an Invoice First"
Else
DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub

Using this code not only does my report not detect the correct fields to import data (no data is filled in) but it requerys the invoice or atleast should, which I could do with out all of that code...

Where should i go from here?

View 1 Replies View Related

Placing A Report Filter At Startup Of A Report?

Jul 25, 2013

The company I work for has branches in multiple states and we use Access to organize all their tax requirements. We print out reports for every month, and my company would like to create a pop-up window that will let us filter the report when it starts up so that it automatically shows only the dates that we wish it to. How do I create a filter that pops-up when the report starts?

View 1 Replies View Related

Combo To Filter Subform From Another Subform?

Feb 2, 2015

Main form frmSiteDetails

frmRooms (subform) holds Room information for the rooms on each floor. This form has LinkMasterField [SlaveFloorsID] and LinkChildFields [FloorsID]

frmFloors subform holds floor information for each floor in a property. This form has LinkMaster [SiteID] and LinkChildFields [SiteID]

Both these forms sit on a Tab Control (TabCtl57) and do work properly.

What I would like to do is to also have a Combo to pick a floor number from frmFloors and filter frmRooms. Both these forms have FloorsID fields. This would save a user having to go back to frmFloors to pick a different floor and then go back to frmRooms to view the room data for the new chosen floor.

View 2 Replies View Related

Help With A Subform Filter

Aug 8, 2005

I am relitively new to access but I am learning ;)

I am creating a database that will hold details of hand held scanners that are sent out to various customers. This records the product and serial number etc. I have got the products and supplier tabs that I have specified on the 1st form "end_user" working fine and put in some basic error checking such as locking fields.
The orders form is to show all the orders that were placed by a particular customer, refered to by "end_user_number (autonumber) primary key" and "end_user_description (Text)"
I can now add orders to the database fine and have managed to get the subform to refresh and show details of the newly added order by tagging the requery command onto the end of the save button, so the record gets saved and then the subform refreshed.
The problem: I just cannot figure what I am doing wrong! The subform in order history displays all the orders from all the users where I want to filter the orders that the current end_user_number is related to. I have tried using the child filter and master filter with no luck and am trying to code a VB line to filter instead (currently a temporary command button on the ordershistory subform) but I am not sure of the syntax. Any ideas greatfully recieved!
:)


Code Attached

View 9 Replies View Related

Filter Subform

Aug 22, 2005

How do you filter the subform so that it only returns data regarding the current week ending and no data before this date.

Many thanks,

Andy :confused:

View 1 Replies View Related

Filter On Subform

May 10, 2005

I have a unbound form with a bound datasheet subform on. I want to be able to change the filter on the subform from the main form i.e. on the click of a command button.

The problem I am having is setting the filter on the subform from the main form using VB. The subform does not seem to show up in the forms collection.

Any help would be much appreciated.

Thanks

View 2 Replies View Related

Filter Combox On Subform Value From Another

Oct 12, 2005

I ve searched these forums but cant for the life of me find the answer althought there are a lot of posts on combo box filters.

I have MainForm based on tblStaff. I have SubForm based on tblTimesheet.

They are linked by StaffID.

The user selects a Project from ProjectID in the Subform which is filtered to only show Projects assigned to that user. This is done by filtering the combo box by StaffID from the MainForm. Works no problem.

The problem i have is in the next combobox which displays the potential activities for the user. As there are about 80 potential activities i want to filter this based on the Project Role. There are only 5 project roles. I can refer to the project role in either the SubForm query or the ProjectID combobox query but it doesnt work.

I hope this is coherent. Could anyone suggest some code or query parameters for this!?? I'm not an idiot but im beginning to wonder.

Thanks in advance

View 1 Replies View Related

Subform Wont Filter

Jan 19, 2006

Hi all,

i have a subform as part of a larger form used for entering grades.

the form references a table with grades for all terms, im trying to get the form to just display the grades for this term which is identified by a field: ExamId = JsGrades2 using the filter option in the properties box for the form.

I dont have a filter applied to the main form and ive tried putting the filter on the table instead but either way doesn't work.

i could do a query and reference the table but would like to know why i cant the get the filter field to work.

cheers

greg

View 2 Replies View Related

Filter A Subform Using A Combo Box

Mar 9, 2006

I have a form with a combo box on it.

I want to use the combo box to query a subform.

So basically when you click on the record in the combo box it will filter the subform based on the selection.

Is there is a simple way or do I need to be more specific about the requirements ?

Any help would be greatly appreciated.

Domble

View 2 Replies View Related

Forms :: Filter SubForm Using Like?

Apr 7, 2014

I am trying to apply a filter to a subform using the text filter Like "*text*" by setting up a dynamic SQL query for the subform, see code. The issue I have is that the SQL doesn't seem to apply to the form because it isn't filtering the form.

Code:
If Not IsNull(Me.ID) Then
pubRecCountPubs = 0
Dim strSQL, strSelectText, strWhereText, strOrderText, strFilterText, strAuthorText As String

[Code]....

I have this working fine in a 2010 database using the DoCmd.ApplyFilter method, but need to set up a similar database using 2003 and DoCmd.ApplyFilter doesn't work with subforms and I can't figure out why this code isn't working.

View 7 Replies View Related

How To Filter Subform OnLoad

Mar 20, 2014

I have a subform inside of a form. The form has info about an entire group of parts and the subform contains a list of all the parts in that group. What I want to do is just filter out the parts in the subform whenever the form/subform loads which do not have a 'deleted' checkbox checked. (No parts in the database get deleted; if someone deletes a part I just want it to add a true to the 'deleted' flag field for the part and then that part doesnt show up in regular part lists anymore).

View 1 Replies View Related

Form Filter Not Working In Subform

Aug 8, 2005

platform : access (adp) / sql server
Problem : form filter not executing in subforms

When I goto one of my subforms I can activate the form filter.
When executing the form filter no records show up, it just keeps showing my criteria. When disactivating the form filter I receive an error message telling that my view must be misspelled (it's about spaces). My view is called Vw_people , as a record source it works fine so it can't be misspelled.

Is the problem the adp connection or the subform? I don't know

View 1 Replies View Related

Filter Main Form From Subform

Nov 16, 2005

I have a main form that contains basic project information, and one of many subforms that contains project manager and contract information. (forms and subs linked by project ID) My project managers want to have the ability to only show project records that are theirs. I can make a filter based on any field in the main form without a problem using code like below.

Dim strFilter As String
strFilter = "ILFID Like '*FME*'"
Me.Filter = strFilter
Me.FilterOn = True

How do I write a filter to reference the project manager field in a subform that will actually filter the main form and subform records?

Thanks!

View 7 Replies View Related

Filter Subform Based On Combo Box

Dec 13, 2005

Hello everyone!

I think I am asking the impossible, but can't think why it can't be done!

Here's the dilema:

I am working with an unbound form to search a Mobile Register.

On the form I have an unbound combo box which looks up User details from a table (LKP_User).

When I select a user, I want the subform below to filter all the details for that user and show me which mobiles they have.

PROBLEM:
Combo Box has 3 fields, User_ID, User, Dept_ID. User_ID is bound column but not displayed in combo (only User) is displayed.

I need to link the User_ID with the User_ID on the subform, but don't know how to tell it to look at column 1 of the combo box.

Can anyone point me in the right direction? Do I need some fancy code to get this to work?

Cheers in anticipation
NKA

View 6 Replies View Related

SubForm Filter Based On A ComboBox

Aug 18, 2006

I am running into a problem with just one form in my database. I was getting the error 'Can't build a link between unbound forms'. After searching here and elsewhere the solution is/might be to type the linked fields into the child and master proprty fields. However when I do that I still can't get this form to work. Would anybody please take a look at the file attached - I trimmed it down to two tables with a few records and a form/subform.

I want to make a selection in the combo box and have the filtered results displayed on the form below - simple and I have done the same thing in the database elsewhere but I just can't see why it won't work here.

Thanks

Steve

View 3 Replies View Related

Modules & VBA :: Filter On Subform Not Turning Off

Feb 2, 2015

I'm filtering a sub form in datasheet using an option group frame, and the on click does exactly what I want it to do.However, Once I'm done filtering, I can either set the filter to all ...

Code:

Case 1
Forms!frmmain!frmtoplinelist.form.FilterOn= False
Or click a Button "Remove Filter"

Code:

Private Sub btnClear_Click()
Me.frmTopLineList.Form.FilterOn = False
End Sub

(I've tried both references to the subform too... "Me." and "forms!etc. However, the subform filter isn't switching off.

View 4 Replies View Related

Forms :: Filter Changes Subform Info

Jun 26, 2013

I have a CRM database which also handles billing for my company. I have an Order Form which displays info from the Orders table, and also various subforms from related tables (Order Details, Payments, Collection Notes). The Payments table has a One to One relationship to the Orders table and the two are linked by the Key Field Order ID.

Here is the problem, if I open the Order Form and navigate to any record the correct payment information is displayed. However if I use a Filter on the Order table the Payment information disappears and only a blank payment form displays - making it appear that a payment has not been made. If I remove the filter the payment information is still gone until I close the form and reopen it. Also, this does NOT happen to my other subforms (ie Order Details) - note that the other subforms are for tables with a One to Many relationship.I have tried basing the subform on the actual table Payments and also on a query of the payments table.

View 3 Replies View Related

General :: More Than Two Criteria To Filter A SubForm

Sep 28, 2012

I need to filter a subform based on the values on the mainform.

Criteria are Multiple. The idea is to show the user the records that are already existing in the table.

First two criteria works, stuck with the third one

I.Criteria - Creative(text type)

Private Sub Creative_AfterUpdate()
Me.frmCommercialWithDetails_subform.Form.Filter = _
"Creative ='" & Creative & "'"
Me.frmCommercialWithDetails_subform.Form.FilterOn = True
End Sub

[Code] ....

Also, how to split the code into two lines

"Creative ='" & Creative & "' And Act_ID = " & Act_ID

when broken into:

"Creative ='" & Creative & "' _
And Act_ID = " & Act_ID

is automatically saved as:

"Creative ='" & Creative & "'" _

And Act_ID = " & Act_ID " and this generates an error on execution.

View 5 Replies View Related

Forms :: Filter Data In A Subform

Jun 14, 2013

I have a subform in a form that displays all members of staffs Name and employee no. I am trying to find a way to search the subform on the main form it's on using textboxes to filter data, here is the code I have that searches the employee no.

Code:
Private Sub Command178_Click()
Dim dbs As Database
Dim qdf As QueryDef
Dim sqlstr As String
Dim sqlstrwhat As String
Set dbs = CurrentDb

[code]....

I do not get any errors and I haver used the same code structure for other subform filters but when I search for an existing employee no. the subform only displays a blank record with the employee no. 1?

View 5 Replies View Related

Forms :: Adding Filter To A Subform

Feb 25, 2015

I am trying to apply a filter to a subform.I have three tables as follows:

ITEM (primary key Item ID) (AutoNumber)
CREATOR (Primary key Creator ID) (AutoNumber)
ITEM CREATOR (junction table) (primary key Item ID and Creator ID)

ITEM has a one to many relationship with ITEM CREATOR.
CREATOR has a one to many relationship with ITEM CREATOR.

I have added a subform to the data entry form for ITEM. The fields in the subform are the fields in the ITEM CREATOR table, i.e. Item ID and Creator ID. The purpose of the subform is to link an Item to a Creator and populate the ITEM CREATOR table.These are the subform properties:

Record Source: Item Creator subform
Link Master Fields: Item ID
Link Child Fields: Item ID

The subform contains a combo box for Creator ID. These are the properties.

Control Source: Creator ID
Row Source: Item Creator Subform query
Bound Column: 1
Column Count: 9

When a user clicks on the combo box drop-down, the first 9 fields in the CREATOR table are displayed. The purpose of this is to give the user more information when linking ITEM to CREATOR, so that the correct Creator ID is chosen and the Item is linked to the correct Creator. Two of these fields are Creator Surname and Corporate Creator.

The issue is that CREATOR now contains over 2500 records. When trying to link an Item to a Creator the drop-down list that appears when the Creator ID combo box is clicked is very long and the user is potentially faced with a long time spent scrolling the list. I would like to filter the drop-down list by Creator Surname so that the user enters a surname and only the Creator IDs for the Creators that have that surname appear in the list.

View 1 Replies View Related

Forms :: Using Combobox To Filter A Subform

Jan 14, 2014

I do review SQL sometimes to check what's going on. Access has been a steep learning curve, but my understanding of queries and relationships improved a lot recently.Some of the finer points of forms are just giving me frustration. My form related knowledge probably lags behind my data/table/relationship/query related knowledge. Its probably simple, but as you know these things are not too intuitive at first.

I have a query which (built on another query and some tables in turn) delivers exactly the data I want. I want that data to come up in my form (or datasheet subform actually) BUT, I want to be able to filter for PERSON.ID. I want the user to be able to use a combo-box to do that filtering.

OK then, main form, with unbound combo-box at the top. I assume it should be unbound because I don't want any data edited based on selections which are supposed to cause temporary filtering only (correct me if I'm wrong). For the Row Source I've used a qryWholeName. This query creates a WholeName for each person, and includes their PERSON.ID as well.

[URL]....I cannot see the example DB they have attached in the thread. Finally, my database is likely to be accessed by several people at once. Different users will want to be selecting and filtering for different people simultaneously.

View 3 Replies View Related

Forms :: Applying A Filter To A Subform?

Jun 22, 2014

Was trying to use a button to apply a filter from a form to a subform

the subform (frmLogOverview_Subform) has a field call AttendedBy_FK and I wish to filter this from the main form (frmCallOverview)

how can I do it ?

View 2 Replies View Related

Modules & VBA :: Order By On Subform Filter

Aug 30, 2013

I am a VBA beginner and am using Allen Browne's method for filtering a field in a subform: URL....It works well except that I cannot seem to figure out how to order the results when the subform field is filtered. I want to order the results by CompanyName.Here is the code I am using for changing the record source from the main form to the subform:

Code:
Dim sSQL As String
If Me.cboFilterFavorites = Null Or Me.cboFilterFavorites = "In Business" Or Me.cboFilterFavorites = "Out of Business" Or Me.cboFilterFavorites = "Unsure" Then
If Me.RecordSource <> "qryCompanies" Then
Me.RecordSource = "qryCompanies"
End If

[code]...

I feel as if I have tried everything. I even changed the subform record source from a table to a query (qryCompanyTypes) so that I could add the CompanyName field and sort but to no avail. I have tried adding the CompanyName field to the SQL string but keep getting errors. I have tried simply using Order By in the SQL and still get errors.

View 2 Replies View Related

Forms :: Hold Filter On Subform

Jul 30, 2014

I'm trying to make it so I could filter a subform from the main form and it will hold those results and allow them to be edited in the subform without it refiltering it. I want it to still be able to update the table by whats edited in the subform, but I don't want it to "disappear" from the subform when the filtered "matching" criteria is changed on a record.

How could I go about accomplishing this?

Here is my code for the filter of my subform:

Private Sub Form_Load()
strFilter = "[Rep Number] = " & "RepNumberField" & _
" AND " & "[UserName] = " & "UserNameField" & ""
RepReassignmentSubform.Form.Filter = strFilter
RepReassignmentSubform.Form.FilterOn = True
End Sub

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved