I am trying to hide a row when the id = 0012. My report has a group and detail level rows in it.
I also have one more filter Expanded, which I use to hide and show the detail level rows.
This is my if statement that works correctly to show and hide the detail level rows.
=IIF(Parameters!Expand.Value = False , True, False)
Now how can I hide the id = 0012 row from showing up regardless of what value I pass onto my if statement. I do not want to show the 0012 id at all in the report.
I tried this
=IIF(Parameters!Expand.Value = False or (Fields!ID.Value) = 0012, True, False)
but this only works or one of the values for my Expanded filter, when I chose false, I am able to collapse the detail row and see it again.
Related
I have a ComboBox which will display data which dependent on what has been entered in another ComboBox. The second ComboBox is not updating (showing) data in the dropdown after the first has been updated...
Company_Select_Combo is the first ComboBox. After a selection has been made in this combobox, Marketer_Select_Combo becomes visible on the form, and this query should reflect those marketers associated to the company selected in the first combo...
Help
Private Sub Company_Select_Combo_AfterUpdate()
If Company_Select_Combo > 0 Then
Company_Select_Combo.Enabled = False
Marketer_Select_Combo.Visible = True
Me.Marketer_Select_Combo.Requery
Else
Marketer_Select_Combo.Enabled = False
End If
End Sub
Let assume your "Marketer_Select_Combo" query includes:
Marketer_ID, Marketer_Name, and Company_ID
Then simply add the following statement to your SQL:
WHERE Company_ID = [Forms]![yourformname]![Company_Select_Combo]
This way, the elements should be limited to the chosen company. By calling the Requery/Recalc method as you did, it should work as intended.
I have a serch form and I want to be able to change value of text box field in a specific found record.
I have a combobox named Combo2 and a text box named TextBox1. I want to based on the selection in the combobox Combo2 change behaviour of the TextBox1. Problem that im suffering right now from is that selection of any record makes changes to all records not just the one I want.
Example: I look for a specific item and I get result that I have 5 items in Germany, 2 in England, 8 in Italy and 4 more in England. Now I want to move 2 items from England to Spain. When I select Spain in Combo box all TextBoxes in all records become inactive. I want only the textbox of record that I have changed to be inactiv.
Private Sub Combo2_AfterUpdate()
If Me.Combo2 = "England" Then
Me.TextBox1.Enabled = True
ElseIf Me.Combo2 = "Germany" Then
Me.TextBox1.Value = "Ger"
Me.TextBox1.Enabled = False
ElseIf Me.Combo2 = "Spain" Then
Me.TextBox1.Value = "S"
Me.TextBox1.Enabled = False
ElseIf Me.Combo2 = "Italy" Then
Me.TextBox1.Value = "I"
Me.TextBox1.Enabled = False
Else
Me.TextBox1.Enabled = False
End If
End Sub
That is by design. A control in a continuous form will behave and react the same on all records except for the Value property (which is bound to the record).
So you will have to rethink your concept and how to navigate the form and records.
I have a tabbed control (TabCtl45) in the "Detail" section of my report that that has three tabs. (Page1, Page2, Page3). I only want to show one page depending on another variable known as Fee Type. If FeeType = 1, then Page1 tab shows. If FeeType = 2, then page Page2 tab shows... etc.
I was able to make this work in "Print View" with the OnFormat event; however, I want all my data in one easy flowing page like report view. Not in separate pages like print view outputs.
The code looked like this:
If Me.FeeType = "1" Then
Me.TabCtl45.Pages("Page1").Visible = True
Me.TabCtl45.Pages("Page2").Visible = False
Me.TabCtl45.Pages("Page3").Visible = False
ElseIf Me.FeeType = "2" Then
Me.TabCtl45.Pages("Page1").Visible = False
Me.TabCtl45.Pages("Page2").Visible = True
Me.TabCtl45.Pages("Page3").Visible = False
ElseIf Me.FeeType = "3" Then
Me.TabCtl45.Pages("Page1").Visible = False
Me.TabCtl45.Pages("Page2").Visible = False
Me.TabCtl45.Pages("Page3").Visible = True
End If
How do you I get this code to work in report view from the "Detail" section of my report? There is no event that I can see working for this purpose in the properties "Detail" section.
You can't. The Report View is rather limited, the section events (like Detail.OnFormat) simply don't run in this view. Only in Print/Print Preview.
The only thing you can do to format single records in Report View is Conditional Formatting, but that's no use to hide things.
On an unrelated note, you can simplify your code a lot by doing:
Me.TabCtl45.Pages("Page1").Visible = (Me.FeeType = "1")
Me.TabCtl45.Pages("Page2").Visible = (Me.FeeType = "2")
Me.TabCtl45.Pages("Page3").Visible = (Me.FeeType = "3")
I have two columns one [CUS SKU], the other [UPC].
I have 2 specific id's 1234, 1233 and many others but only care if these two show up.
My problem-
If either of these two show up on both columns I only want to display one column and hide the other.
If another id is displayed in both columns display both.
If another id shows up on either column and neither of the two important ids are shown then display in either of the columns.
also the two important id's will sometimes have 0 or 00 in front, how do i accommodate for that in there as well.
this is what i tried in each column but had no luck, it was displaying the same.
=IIF (Fields!CUS_SKU.Value = ("1234") or Fields!CUS_SKU.Value = ("1233") and Fields!UPC.Value = ("1234") or Fields!UPC.Value = ("1233"), True, False)
and
=IIF (Fields!CUS_SKU.Value <> ("1234") or Fields!CUS_SKU.Value <> ("1233") and Fields!UPC.Value = ("1234") or Fields!UPC.Value = ("1233"), False, true)
When mixing AND and OR in a condition, you need to use parens carefully. Try this:
=IIF ((Fields!CUS_SKU.Value = ("1234") or Fields!CUS_SKU.Value = ("1233")) and (Fields!UPC.Value = ("1234") or Fields!UPC.Value = ("1233")), True, False)
Access 2007: Is it possible to enable/disable one column in a List Box on a form. For example: Say you have 2 columns A,B - If Me.A = title Then Me.B.Enabled = True Else Me.B.Enabled = False.
If so, where would it go? On Got Focus, On Click??
Thanks
I'm not sure what you mean by disable, but you can hide a column by adjusting the ColumnWidth.
So if you wanted to hide column2:
Me.MyListBox.ColumnWidths = (1 in;0;1 in)
And to hide column1:
Me.MyListBox.ColumnWidths = (0;1 in;1 in)