Conditionally disable buttons on continuous forms in Access - ms-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 ...

Related

Is there any way to edit columns with a form in Access?

Seems not to be possible, since Access relates rows not columns, but I would like to have the option to edit columns by a form, for example I have the next table:
Table
I want to allow the user to edit and change the actual name of A1, A2 and A3 by the use of a form like this:
Imaginative Form
The form of the image it's just for ilustrate, not sure but maybe this can be accomplished by some VBA code.
When using the form wizard, create a column-based form. You can of course also create the form yourself. In the details section align the fields as desired:

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.

SSRS Report Builder 2012 - How to hide list based on field value?

I'm using Report Builder 2012 to create a report. I have inserted multiple text boxes and other controls inside a list box so that I can hide all the controls at once just by hiding the list box. I'm using a SQL Server stored procedure to fetch rows of data. I'm using below expression to hide/show the list box.
=iif(Fields!certificateType.Value = "CT", False, True)
It works fine but it only checks the first row of data. If certificateType field is "CT" in the first row of data, it shows the list box but it doesn't hide the list box back for the next row of data in which certificateType is not "CT". It seems like list box visibility only checks the first row of data and applies it for all the other rows as well. How can i check the visibility of list for all the data rows?
Okay, based on our chat I have updated this solution.
I mocked up some data that looks like this:
certificateType
---------------
AT
BT
CT
DT
ZT
I created a quick and dirty report with a list. In that, I added a rectangle with a textbox in it. I set the dataset for the list to the main dataset (DataSet1 in my case). I set the expression for the textbox to this:
=Fields!certificateType.Value
Image in design mode:
I clicked on the list, and in the Row Groups pane, I right-clicked the Details rows, and chose Group Properties. On the General section, I clicked Add to add a new group expression. Then I chose certificateType from the dropdown.
I moved to the Page Break section of the Group Properties dialog and ticked the Between each instance of a group check box. Click OK.
Now, the report will break for each instance of a certificate type that comes in the dataset. So, if you have ten different cert types in the data, you will get one page for each.
You can't see it in my image below, but there are 5 pages now.
Hope this helps!!

Filter and then Save

I have a two forms: "Cover" and "Form_1".
I have two comboboxes in "COVER". One contains a list of years and the second contains a list of names. The first one is of type Number and the second one is Text.
On the "Cover" there is a button which takes takes you to "Form_1" upon a button click.
"Form_1" contains the same two dropdown menus from "COVER" and it stores the exact values chosen from "CoveR".
The problem:
The problem is that it should be able to filter out specific data upon choosing specific values from the dropdown menus and then save. But it saves the chosen values from the dropmenu first and then filters out the data. So, the same data appears for 2011 and 2012.
It should be able to filter about the specific data first and then save.
Is there any way of doing this? for example, creating a "save" button so that it only saves upon a button click?
I think i figured out the solution:
Just link the fields to the comboboxes on click.
stLinkCriteria = "[Program_Name]='" & Me![Combo2] & "' AND [BudgetYear]=" & Me![Combo0]

ms-access calculated controls

can someone give me an example of what a calculated control is in ms-access?
Say you add a text box to a form, normally it binds back to a specific field in a table, and its contents reflect the contents of that field. A calculated control does not refer to a specific field in a table, rather it displays the calculation done on one or multiple fields in the database. Sometimes, it may not use any fields.
Example of control source value from a calculated control
=[YearlySalary]/52
Presuming that there is a field called yearly salary in the table the form is based on.
A control that simply displays this field would have the following in the control source
YearlySalary
Note the control source for a calculated control starts with an =
you mean this?
Setting the Control Source of a control, generally a textbox, to a calculation creates a calculated control:
=1 * 2
=[TheDate] - 1
=[Stock] * [UnitPrice]
=DlookUp("TheField","TheTable","FieldX=1")
Different cases:
Text box control: here you may be using a trim("text") function to remove spaces and clean up the data--that process requires some calculation
List box control: a calculation may be involved in the query that comprises it's row source. The calculation could be the combination of some kind of cyclic function on a numeric field value which then dramatically changes the order of the data if so directed.
Command Button: a variable could change with the number of presses which in turn changes the command mode of the button. Could change the color of the button, or could hide the button after a certain number of clicks, or could change the column of the listbox that is sorted in a query--each click advances the sort to the adjacent column to the right.