passing cascade dropdown value to Gallery on next screen, PowerApps - parameter-passing

I'm doing POC on PowerApps and need help and advice
I connect my app to Excel as data source, ~ 800 records. I intend to pass these cascade dropdown value to my next screen in order to filter my Gallery displaying bunch of data. But I got no value in my Gallery.
Then i continue my experiment to test passing value with Label. I formulate my Next button in passing ONE dropdown value to next screen -- Navigate(Scr_Result,ScreenTransition.Cover,{selectedSite: drop_assetsite.Selected.Result --, i successfully get that value. But when I combine those 3 dropdown value on my NAVIGATE function, i got FALSE on my label text instead
Here is my NEXT navigate formula --- Navigate(Scr_Result,ScreenTransition.Cover,{selectedSite: drop_assetsite.Selected.Result And drop_building.Selected.Result And drop_assetcategory.Selected.Result}) But i found no red X mark on my NEXT button.
I'm not quite sure that I can combine those cascade value in one argument on Navigate or not. I can't find this combination somewhere. Thanks in advance for all replied. ^_^ and sorry for my poor English

You can use an expression like this one:
Navigate(
Scr_Result,
ScreenTransition.Cover,
{
selectedSite: drop_assetsite.Selected.Result,
selectedBuilding: drop_building.Selected.Result,
selectedCategory: drop_assetcategory.Selected.Result
})
And in Scr_Result you can access the three values (selectedSite, selectedBuilding, selectedCategory) in any expressions on that screen.

Related

Paste a value in a textbox on the second tab of a navigation form access vba

I'm quite new to VBA and I've been looking around but cannot seem to find a solution to my problem.
I have made a navigation form (frmNavigation) with 3 buttons, each referring to a different form, let's call them frm1, frm2 and frm3. In the navigationform the control buttons to switch between tabs are all named differently (btn1, btn2, btn3), but the subform that shows either frm1, frm2, or frm3 has the same name: “NavigationSubform” (this shows a different form depending on which tab is clicked on, based on the 'navagation target name' referring to frm1, frm2 and frm3).
When I want to refer to a textbox (txtBox1) on form 1 (first tab) and insert a value i can do this by:
Forms!frmNavigation!NavigationSubform.Form!txtBox1.Value = "insert awesome text"
But how would I refer to txtbox10 on the second tab (frm2)? Just using the following does not work:
Forms!frmNavigation!NavigationSubform.Form!txtBox10.Value
You then get the error 2465 (can't find the field).
I’ve been trying many different things, but can’t seem to get it right. So how do I refer to a textbox on a different tab than the first one?
Help us much appreciated!
Only one subform can be loaded at once. So you've just got to break this process into two steps.
Store the value from txtBox1 somewhere outside of the NavigationSubforms (a textbox on the parent form with visible = no, a global variable or a table works).
In frm2's On Load event, set txtbox10 to be the value you stored.
Just note, that you will need to add conditions in the On Load event if you want to avoid that textbox being set to an empty string or a wrong value if you have a setup where your filter is changing.

Update Display for Combo Box

I have a form with multiple combo boxes, these boxes have 2 column list where column 0 width is zero. All these boxes have row sources defined for their drop down list values.
When I try to over ride the display value of the combo boxes via vb code, it works for few of the controls while doesnt do anything for the rest. So I made an isolated code just to update values of all combo boxes(cbo) and again the same controls pass/fail. Here is the code I am trying to work with, can anyone please tell me why I am unable to update some combo boxes while others work fine?
Thanks!
Sub test()
Dim Ctrl As Control
Dim CtrlName_Combined as String
For Each Ctrl In Forms("frmNewTransaction").Controls
'Name of all combo boxes start with 'cbo'
If Left(Ctrl.Name, 3) = "cbo" Then
Ctrl = "Hello"
CtrlName_Combined = ctrlName_Combined & Ctrl.Name & " "
End If
Next Ctrl
MsgBox CtrlName_Combined
End Sub
Here is screenshot of the form after code run (All Combo boxes start with cbo):
Thank you guys for the help. The problem started when few of the combo boxes did not take value when i executed:
forms("FormName").Controls("ComboBoxName")="Some Value which was in the list"
So I tested all my combos by passing them value "Hello" which I know was not in their row source. Strangely so few combos responded and others did not. This was the rabbit hole as all my combos were configured same apart from their row source queries but all had an ID and eName column.
Problem was that few combos were not taking the text values I passed them but turns out that if I gave them Numeric value according to the first column they start responding (what i dont get here is that how some combos behave one way and rest the other way)
Anyway this helped me get past the problem, thought i should share this after bothering you all with it.
Also I am seeing that the question or manner was not well received by the community, would be helpful if someone pointed out what not to do for future references
Thanks Again!

lightswitch many to many checkbox filter

Hey guys I have a many to many checkbox where a user can select many cities. I have a dropdown list above for selected state. I want to bring back only the regions that belong to that state that is selected.
thanks
Have you considered using a List and Details Screen instead of a dropdown list? You would just need to add both the states and cities tables to the advanced data section.
However, if you really need to use a drop down box, it is very complex but can be done.
You will need to begin a new search screen and lay it out as follows:
Create a group to start. You will need to 'add data item...' and choose Property, StateTable. Name this 'State' and add it to the group.
Create a second group. Again 'add data item...' Choose Query, CitiesTable (All). Name this StateCities. In the side panel, click 'edit query' next to StateCities and set it up as follows:
Return to your design screen by clicking the 'back to -screenname-' just above the filter statement. You should now see three bold items in the sidebar to the left. The first will be your StateTable, the second will be your StateCites query and the third will be your single State query.
Click the dropdown button for the StateCities query and you will see the query parameters at the bottom. You have a parameter called 'id'
Click on the Id parameter from the sidebar and change the parameter binding property (shown on the right hand side bar) to State.Id. If everything has been done correctly, this should hook up to your state query id field.
Once this is hooked up, you should be able to save your screen and run your program with the desired results!

Conditionally disable buttons on continuous forms in Access

I have a continuous form in Access 2010 with a delete button that shows for each record shown on the form. I only want the delete button enabled on the very last record shown. I am stumped how to do it. Any help greatly appreciated. Thanks.
In access there is only one instance of a component on any form - in continuous forms its just copied several times. The only way you can have anything different on any single row in a contiuous form is through data (obviously) and through conditional formatting of a data aware component: the textbox.
And the formatting options are also quite limited. So there are two options: EITHER use a textbox that has the same background as the form and create a conditional format that changes the backcolor for the last row OR create table (ID,PICTURE) with two rows - one with a transparent picture (ID=1) and one with the picture of a button (ID=2) - and link it in the recordsource (Somethig along the lines of: SELECT .... pic FROM yourtable INNER JOIN pictable ON pictable.ID = yourtable.isLastRecord ...

Only allowing one Drilldown in SSRS

It took me hours of searching and putting together piecemeal parts to find the solution to this, so I figured I'd post it on here in the hopes of helping someone else.
The Problem: We need to display a report, with proper grouping and drilldowns. However, we should only allow one group to be drilled down at one time.
SSRS doesn't exactly have robust scripting options - for instance, you can't close other groups "on click" or anything like that. So how do you do it?
In My example i'm using the AdventureworksDW database. I want to have a dataset that includes the total sales for each group and region. My Stored Procedure looks something like this:
SELECT dst.SalesTerritoryGroup,
dst.SalesTerritoryRegion,
SUM(fis.SalesAmount) AS SaleTotal,
DATEPART(YEAR,fis.OrderDate) AS OrderYear
FROM [dbo].FactInternetSales AS fis
INNER JOIN [dbo].DimSalesTerritory AS dst
ON fis.SalesTerritoryKey = dst.SalesTerritoryKey
WHERE fis.OrderDate < #QueryEndDate
GROUP BY
dst.SalesTerritoryGroup,
dst.SalesTerritoryRegion,
DATEPART(YEAR,fis.OrderDate)
UNION ALL /*The ResellerSales table. Same info.*/
From there I added a table with two groups: SalesTerritoryRegion and its parent, SalesTerritoryGroup. I also added a column to the left INSIDE the SalesTerritoryGroup, with an X (this can also be an image if you'd like). This is the "Drilldown" button that we'll use.
Create a string parameter, mine was #ExpandedGroup. Set the Default to an empty string (so that all the groups start out collapsed). Right click on the SalesTerritoryRegion group, or whatever your subgroup is, and go to the visibility tab. Click "Show or Hide based on Expression" and enter something like this:
=iif(Parameters!ExpandedGroup.Value="" or
Fields!SalesTerritoryGroup.Value<>Parameters!ExpandedGroup.Value,True,False)
This statement means: If we haven't opened a dropdown, or if the dropdown isn't the one selected, set hidden to true. Otherwise, false.
Next click on your "X" column to the left of SalesTerritoryGroup or your supergroup. Right click to go to Textbox Properties. Click the action tab. From there select "Go to Report". When you specify a report, make the target itself (For instance, mine is Main). Then, add parameters to the report.
The most important here is ExpandedGroup. The name should be ExpandedGroup, but the value is not just [ExpandedGroup]. Instead, it's an expression:
=IIF(Fields!SalesTerritoryGroup.Value=Parameters!ExpandedGroup.Value,
"",
Fields!SalesTerritoryGroup.Value)
This expression says: If the Group is the same as the Expanded group, make ExpandedGroup an empty string when you load the report. Otherwise, send the TerritoryGroup value. Essentially, this will let us toggle on and off the drilldown (same as you would in the report if you had traditional drilldowns).
Note: Also be sure to pass other parameters! For instance, my query requires a date to exclude some transaction data. If you don't pass this parameter in the "Go to Report" action, then you'll have to enter it again when you DrillDown. This also means you can give yourself even more flexibility when you click a drilldown (changing a chart that's displayed etc.) which is what I'm doing for this project.
Hope it helps someone out! Of course, if there is a more elegant or simpler solution I'd absolutely love to hear it.