Opening A Subform Based On Criteria From A Combo Box

Sep 30, 2004

The posting in archive t-31918 was very helpful and almost does the trick. I have a subform with gifttype that has only giftID and gifttype. There are four different gift types and I need a subform to open in a specific location, as a subform. The code given by the archive (my version):

Private Sub Gifttype_AfterUpdate()
If Me.[Gifttype] = "restricted/unrestricted" Then
DoCmd.OpenForm "frmgift1"
ElseIf Me.[Gifttype] = "planned gift" Then
DoCmd.OpenForm "frmplannedgift"
End If
...

Opens what I want as subform as a regular form.

How can I get the correct subform to populate a certain area on the master form?

Thank you!
Pat Wright

View Replies


ADVERTISEMENT

Opening Forms Based On Criteria

Feb 12, 2006

Hello everyone,

I have a problem with opening forms.I have situation with 8 forms (small ones!) which must be open based on values in ComboBox1 and ComboBox2.
Can I do it with Select case (DoubleClick event), and how?

THANK YOU IN ADVANCE,

View 4 Replies View Related

Novice Q: Opening Forms Based On Criteria

Feb 7, 2005

Hi folks,

I have a form with a regular save record command button, however I also want to add in an action to open a second form based on information stored within the form.

So users may be directed to Form.alpha or Form.beta depending on their data.

Can any one help?

View 1 Replies View Related

Opening Subform Based On A Certain Condition

Jan 24, 2006

I have 2 combo boxes which I select a 'Year' and an 'Incident'. Based on 'incident', a listbox lists whether it was a 'bad' or 'good' incident.

I only want my subform to pull up the record if the listbox says 'bad'. how do I do that?

View 3 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

Mar 20, 2013

I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.

View 3 Replies View Related

Combo Box Filter In Subform Showing Blank At Form Opening

Feb 26, 2015

In the Purchase Order details form a Supplier has to be chosen via a combo box. Based on that another combo box in the subform displays products only from this supplier (Products table is linked to supplier table).

I managed to let the subform combo show only relevant products using criteria referring to the main form combo box. Also other product data will show accordingly in text boxes. So far so good.

However when I close the form and reopen it the subform combo box is blank, other text boxes still show the right values. If I remove the filter criteria for the subform combo then all fields show all data correctly. (However the combo box is unfiltered again 8-/)

So somehow the 'criteria' prevents the combo to show the value that was previously chosen.

View 2 Replies View Related

Filter Form Based On Subform Criteria

Feb 28, 2005

I need to open my form with a filter attached that is based on criteria already existing in the subform. I've tried putting the following code in the OnOpen event of my main form :
Code:Dim stDocName As StringDim stLinkCriteria As StringstDocName = "Campaign Form"stLinkCriteria = "[Campaign - Last Contact Status subform].Form![Communication Response] in ("2","4","10","11")"DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormPropertySettings, acWindowNormal

Basically I want to open my main form (Campaign Form) and only show records where the "Communication Response" is 2,4,10 or 11(a variable on my subform "Campaign - Last Contact Status subform"). Which in itself is a problem because I can't seem to code all of these variables- it will only accept one.

When I run the above code I am getting asked to enter a parameter value for "Campaign - Last Contact Status". I'm not too sure where this is picking this up from or how to fix it. I've even tried to run this based on the underlying query of "Campaign - Last Contact Status subform" with the same results.

Can someone help me? All I want to do is open the form based on the criteria I specify which is contained in a field in the subform. It doesn't sound that hard but it seems to be getting the better of me!

View 4 Replies View Related

Filter Main For Based On Subform Criteria

May 2, 2005

Hi,
I've posted this same question a few months ago, started something else and forgotten about the problem, now I really need to solve this! (I had no luck with the original post - code still not working).

I want to apply a filter to my main form based on criteria showing on a subform. This is the code I've got (applied to the OnOpen event of the main form):

Code:Private Sub Form_Open(Cancel as Integer)Dim stDocName As StringDim stLinkCriteria As String stDocName = "Campaign Form"stLinkCriteria = "[Forms]![Campaign - Last Contact Status subform]![Communication Response]=1" DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormPropertySettings, acWindowNormalEnd Sub

The main form is called Campaign Form
The subform is called Campaign - Last Contact Status subform
The field I want to filter on is Communication Response

The criteria I want to filter is : I only want to show records from the Campaign Form (main form) where the status of the Communication Response on the Campaign - Last Contact Status subform (subform) is equal to 1.

I've tried a few variations of the above code but the results are always the same - prompting to enter a paramater value. Now I'm just fishing and hoping I'll get it right.

FYI. the subform only contains one record for each record on the main form. It works a bit like this :
Customer||Date||Communication Response(1=open, 2=closed)
One||20/4||1
Two||21/4||2
Three||21/4||1
One||23/4||2

The corresponding record on the subform for customer One will show the communication response of 2 as this is the most recent date. Therefore you now have the following :
Customer||Communication Response
One||2
Two||2
Three||1

Now I want to only show those records that have a Communication Response of 1. Remember this field appears on a subform. This is the part I am having trouble coding.

I know I've probably just explained the most irrelavent details but if anyone can help me it would be greatly appreciated!!

View 1 Replies View Related

Filter Master Form Based On Subform Criteria

Jun 12, 2012

I have a Master form which includes tabs within the tab I have subforms. I am looking for a way to filter my master form based on data found within my sub form.

I have a check box within one of the sub-forms called "softwareInstall" if yes the box would be checked. I want to filter all customers within my main form with a check box in my main form to turn on and show all customer who has this box check within the subform SoftwareInstall=True.

View 9 Replies View Related

Queries :: Use Switch In Query Criteria Based On Combo Box

May 15, 2013

On I form I have a combo box called cboMobileStatus.Its row source type is "Value List".The row source is: 1;" All";2;"Has";3;"None".I have a query based on table "tblCustomerContacts" and I want to limit the records returned based on the value of the combo box.So if the user selects:

* All (1) I want all records returned.
* Has (2) I only want records that have a mobile number returned
* None (3) I only want records that do not have a mobile number returned

The field mobile is text (to keep the leading 0)I thought of using the Switch function in the criteria of the query for field Mobile like this:

Code:
Switch([Forms]![frmPrintCustomer]![cboMobileStatus]=1,([tblCustomerContacts].[Mobile]) Like "*",[Forms]![frmPrintCustomer]![cboMobileStatus]=2,([tblCustomerContacts].[Mobile]) Is Not Null,[Forms]![frmPrintCustomer]![cboMobileStatus]=3,([tblCustomerContacts].[Mobile]) Is Null)

but the query does not like it!Am I on the right track, and if so, how should I modify the code?

View 2 Replies View Related

Queries :: CheckBox On SubForm Based On Query To Toggle Criteria

Aug 16, 2013

I have a SubForm "assignments" based on a Query, which has criteria to filter dates and also to filter 0 and 1 of the checkbox ...

The question is:

How do I put in that SubForm one or more Checkbox to "enable" and "disable", only the criteria of such query? So, toggle, for example, those jobs that are not completed (Checkbox of the query=0) and those that do ...

View 1 Replies View Related

General :: CheckBox On A SubForm Based On Query To Toggle Criteria

Aug 16, 2013

I have a SubForm "assignments" based on a Query, which has criteria to filter dates and also to filter 0 and 1 of the checkbox ...

The question is:

How do I put in that SubForm one or more Checkbox to "enable" and "disable", only the criteria of such query? So, toggle, for example, those jobs that are not completed (Checkbox of the query=0) and those that do ...

View 2 Replies View Related

Queries :: Setting Criteria For Query Based On 3 Combo Boxes

Jul 10, 2013

Ok so im working in MS Access 2007.

I want to create a query based on 3 combo boxes but have it so that if the field in the second or third combo box is not populated the query still runs.

Right now i have the Criteria set for the three columns that i wish to sort by as seen below.

Column 1
Criteria: [Forms]![Entity Selection Form]![areabox2]

Column 2
Criteria: [Forms]![Entity Selection Form]![devbox2]

Column 3
Criteria: [Forms]![Entity Selection Form]![entitybox2]

This gives me the correct query result but im forced to make a selection from each combo box. Is there a way to progamme it so that if I only make a selection from the first combobox and leave the others blank i can still get results in a query?

View 2 Replies View Related

Forms :: Print Report Based On Subform With Multiple Search Criteria

Jun 14, 2015

I have a problem printing a Subform that uses multiple criteria(in textboxes) as filters.

The search portion of the form works fine. The problem is I have created a report based on the subform and am using the following code to open/filter the report

Code:
Private Sub PrintBtn_Click()
Dim strCriterion As String
Dim strMsg As String, strTitle As String

[Code].....

View 3 Replies View Related

SubForm Based On Combo

Dec 11, 2005

Hello,

Having Trouble with a Form, Currently the Form is Setup so Data Results can Be Stored, with a Combo Box to Enter a Result RED/Amber/Green. when the Result is Amber or Red, there is a Subform on the Right were People Need to Enter a Value ie the Reason for the Red/Amber. This all Works Fine, However People have a Habit of Not Entering the Values on the Sub Form. I carnt Find a Way to Make the Subform Demand Data if the Value on the Main form is Red/Amber.

Any One have a Idea on the way to do, i.e is there a Property I am Missing or Do i Need to Change the Form so that the Subform Lauches after Update based on result ?

Thanks for Looking

View 3 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

Refresh Subform Based On Combo Box Selection

Dec 30, 2005

I have a form with three subforms, and I'm having problem with one of them. The link between subforms and forms are store number, which is stored in a combo box. Idealy, after a user pick a store from the combo box, the subform would update itself. Two out of the three subforms are based on two crosstab queries and they work perfectly fine. The last subform is a select query, and it seems like it's not rerunning itself after updating the combo box. The query is very simple, it just has store number, description, and grouped by amount. I tried with no criteria in the store field and run the masterform,seems like all it's doing is showing value for the first store in the table, and never changes afterwards, I also tried entering "forms!frmStores!cmbStore" in the criteria for the store, then the subform came out empty, it seems like it's only reading combo box's default value null. I have a line of code for the mater form frmStores as "me.[DisplaySubform].requery" for all three subforms, but it seems like it's working for the first two and not the select query. Anybody can help me with this? oh, the combo box is unbounded, because i do not want my table to be updated by selection. Please help

View 1 Replies View Related

Open Subform Based On Form With Combo Box

Oct 27, 2005

I have a main form (FRMProspects) with a combo box (ComboCoName) that has a query as it's record source to sort the records displayed in it. It is bound by the CustID (autonumber), but displays the CompanyName.

What I want to do is open a sub form FRMNotes, based on the Company name that is selected in the ComboCoName. So for Company XY, I want to click on the Notes command button to open up all the notes for that company only (filtered). FRMNotes is based on a different table, but TBLProspects and TBLNotes are linked by CustID (one to many).

What code do I need for this? I am treading water with VBA!

View 4 Replies View Related

Change An Entire SubForm Within A Tab Based On Combo

Aug 24, 2004

I have a Form with some combo box's in header and a TabControl with 5 tabs in Body.

In each Tab I have a subform. All is working as should.. each form is requerying perfectly based on user combo choices.

What I would now like to do is swap one subform in one tab for another subform, depending on what choice is made in combo box.

That is...

Combo choice 1 ... requires Subform's 1, 2, 3, 4, & 5 in Tab's 1, 2, 3, 4 & 5 ..
Combo choice 2 though... requires Subforms's 1, 2, 6, 7, & 8 in same Tabs. .. Tab's are umbrella's for multitude of subform possibilities.

I really need some guidence here. Thanks.

View 4 Replies View Related

Forms :: Opening Form Based Off Another Forms Combo Box Value

Nov 5, 2013

I'm trying to get a combo box & button to work together. On the main form of the attached database, I just want the button to go to the associated record based off my selection (or entry) in the combo box.

I've tried the following:

- Looked through the Northwind sample database for a close example. Tried my best to replicate the functions but it didn't work
- Looked through other examples posted and tried to manipulate the code to no avail
- Tried using [Forms]![Main Form]![cmbLastName] in both the filter & criteria section of the macro

View 4 Replies View Related

Selecting Records In A Subform Based On Several Combo Boxes

Feb 2, 2005

Here is an example of what I am trying to do:

I have a main form which has 4 combo boxes all based on tblPeople.
Combo0 is skill
Combo1 is discipline
Combo2 is crart
Comb03 is active

The sub form is a datatable list of the tblpeople.

How do I apply the filter to the datatable. I am assuming I need to build a sql statement somewhere like SELECT from tlpeople WHERE me!combo0 = [tblpeople].[skill] and me!Combo1=[tblpeople].[discipline] etc

Is there a sample database? or can somebody tell me how to go about this.

Thanks
Steve

View 11 Replies View Related

General :: Display Record In A Subform Based On Combo Box Value

Oct 11, 2012

I'm creating a database for my inventory. For now, my database have two tables namely tblSupplies and tblDetails. I have a main from (frmMain) and a subform (subDetails). On the main form i have a combobox (cboSupplies) and 5 textboxes, the cboSupplies and the five textboxes are unbound. If I select a value in cboSupplies it will populate the rest of the textboxes-OK.

What I want to accomplish is that when I select a value in cboSupplies it will grab all related records from the tblDetails and populate these records on the subform (subDetails).

SuppliesID was used as the link field from mainform to subform but its not working. Please note that SuppliesID field in tblSupplies and tblDetails has a One-to-Many relationships.

View 1 Replies View Related

Modules & VBA :: Populate Data Sheet Subform Based On Combo Box Selection ALL

Aug 20, 2013

I have an unbound combobox on a form that is used to filter the records of a subform based on who they have been assigned to. The combo box is based off of a query to the personnel table and utilizes a UNION querry to add the option "**ALL**" with a id number "111111" as the first option in the combo box.

In other words: the combo box has a list of names to choose from and the word "ALL" at the top as the first selection. The idea is that when "**ALL**" is selected, the subform should display all records regardless of who they have been assigned to. I'm trying to accomplish this with VBA. I've started developing the code to try to impliment this, however currently when "**ALL**" is selected, I'm getting a datatype missmatch that seems to be caused by my use of recordset.

Option Compare Database
Option Explicit
Private Sub cboTaskListName_AfterUpdate()
'On Error GoTo cboTaskListName_AfterUpdate_Err
Me.Refresh

[code]...

Also once the queried records are saved into the record set, how can I communicate that to the subform so that it displays them?

View 2 Replies View Related

Setting Query Criteria To Be 'blank' Depending On The Criteria Of A Combo Box

Oct 21, 2006

I have set up a database that stores actions (i.e jobs). In the table; two of the fields are...'required completion date' and 'actual completion date'. I wish to lookup, by using a query, all of the open actions (those which havent yet been complete (i.e the 'actual completion date' is null)) and then later on all those which are overdue (i.e the 'actual completion date' is null And the 'required completion date' <today....this being the criteria for an overdue action).

However, I have used a form which has a combo box which contains the values open and overdue. When a selection has been made I want a form to display with the results depending on the selection that has been made. I am capable of creating a form based on a query, but am unsure of how to construct the query with the correct criteria based on the option that is selected from the form.

Any help would gratefully be appreciated. Thanks

View 5 Replies View Related

Opening Form On Multiple Criteria

May 19, 2005

I have a patient form that has a subform showing the care plans. At the side of each care plan for that patient i have a button that if clicked will take you to the specific care plan. I need this to open the care plan form based on multiple criteria which is

Date (Date Field)
Care Plan Number (Numeric Field)
Patient number. (Text field)

These fields are all on the subform and will be populated.

Any ideas? :confused:

View 4 Replies View Related

Opening Two Forms Based On Same Table

Feb 22, 2005

Form #1 allows me to modify/add data to records in Table A.

Form #2 is restricted to displaying (no edit, add, delete capabilities) information from a query that is based on Table A.

I need to find a way to open an instance of Form #2 while in Form #1, but I keep getting the following message...

"The table 'TableA' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically."

Any suggestions for how I can get around this?

The data I want to display in Form #2 is not linked to the record being displayed in Form #1, so a subform will not work.

Thanks in advance!

View 2 Replies View Related







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