How to create a news-reel on a form in access - ms-access

I would like to set up a news-reel on a form to update users on forthcoming changes etc can someone point me in the right direction.

I would recommend using a continuous (sub)form bound to a table News(ID,Timestamp,Info) and sort Timestamp DESC so the last news will always show up topmost. You can also put a query between table and form and use the TOP keyword to extract only the latest N infos. On the other hand you can set a filter on the form to display all news with a datetime higher than DATE() - numDays. There are, as you see, numerous ways depending on your intention.
You can bind the reloading of this (sub)form to the ON_CURRENT event of the parent form so it gets updated each time someone does something in the parent form. If the parent form is never reloaded or flipped but you still want to update on a regular basis during the day you can use the Timer approach as #Horaciux has mentioned.

Related

How to get measurements once I clicked on "Done" button?

I need to get measured values once I clicked on "Done" button, like you can see here:
With other words - when user clicked on "Done" button, I need to "catch" all measured values. How to do that, please?
Thank you
Unfortunately, there is no way to get all measurements currently, there is no function could be used to get all measurements shown on the screen as I know, although you can call measureExtension.measureTool.getCurrentMeasurementRaw() to obtain last created and selected measurement.
In addition, all measurements stored in the measure extension will be deleted while clicking the Done with my research, and the returning value of measureTool.getCurrentMeasurementRaw() will be set to null, too. Therefore, it's hard to achieve what you want so far. Sorry for the bad news.

Rearranging the tab order of fields in a sub form in data sheet view

This is an ongoing problem, and I'm hoping there is just a property that I'm missing.
Scenario: I have a form that contains subforms. The Default View property for the subforms is set to Datasheet. (The main form is set to Single Form). Due to changes in what I'm tracking, I want to include another field that wasn't part of the original record source. So, I changed the record source (a query) and added the field to the subform. The new field is added to the end of the Datasheet view by default.
Here is the problem - when I drag the column to a new location on the subform (in Form view or Layout view), it does not stay put. I have made the change using Form view and Layout view, and I've changed the Tab Index property for the field to the proper number.  The new position never stays on the first, or second, sometimes third and fourth try. I have tried saving in Form view, Layout view and Design view, but I always have to drag the column back to the new position and try to save again . This goes on until Access actually saves the change. drag, save, didn't take; drag, save, didn't take; drag...
What I'd like to know is this - how do I rearrange columns on a form that is set to "Datasheet" for the Default View property, and make it stick the first time?
Thanks for any suggestions - I must be missing something....
This is a known "limitation" of datasheets. Some want the columns fit or preset, other sticky, some either as selected by the user.
To control the order of the columns, adjust the ColumnOrder property of the displayed controls.

Get value of textbox in a table (GAS)

I know that this is something discussed sooo many times, but I can't get the value of a textbox that is placed in a table. I know how to get the value of a textbox (e.parameter.textBoxName), usually it's working without any problems.
The only difference now is that I have a gadget containing 5 tabs, each with some intro text and a table. Each table contains approximately 30 rows, each with two textboxes and a button to submit the value of two textboxes in the specific row to a spreadsheet. Everything is working fine, all the names (and IDs as well) are unique, but the problem is that when I submit textboxes, I get "undefined" (in my spreadsheet).
I guess the problem lays somewhere in the complexity of the script, so this:
function buttonClick(e) {
var app = UiApp.getActiveApplication();
var theValue = e.parameter.textBoxName;
...something...
}
..is simply not enough to define which textbox it is. However I'm getting the button ID without any problem with
var buttId = new String(e.parameter.source);
I'm trying to get my head around this for a couple of days without any results. I'm not that good with GAS and I'm completely out when it comes to objective programming. Do you have some ideas how to get this value? I can get the ID of the table if that helps, but what to use then?
Thank you very much in advance!
EDIT:
I tried .addCallbackElement(textbox) to the textbox - I'm getting an error. I tried .addCallbackElement(textbox) to the submit button together with .addCallbackElement(button) and I'm still getting "undefined".
the callbackElement must be added to the handler, not to the widget nor to the button.
The easiest (and safest) way to get it done correctly is to choose the highest level parent as callbackElement.
I your case it would probably be the tab panel or eventually another panel that contains your 5 tabs if you used one.
Note also that there might be really a lot of widgets in the same UI without causing any issue... I have an app with about 200 textBoxes that works flawlessly and I'm not aware of any limit nor if a limit even exists...

One or multiple forms for chained select boxes?

I want to implement chained select boxes: the first select box determines the values in the second select box. I want this to work in plain HTML first, and add Javascript later.
Should I have both select boxes in one form tag, or have two seperate forms on one page, each with a select box?
If you want to send and retrieve all selected values at once, put them in the same form. If you want to send and retrieve only one at once, put them in separate forms. Simple as that.
One form (at least on the initial page).
Either:
with only one select by default (which is submitted to the server, which returns a new form with a hidden input replacing the first select and a second select chosen based on the option selected) progressively enhanced to generate new selects when options are picked.
with all the selects in the form, with instructions about which one users should use based on their first answer, progressively enhanced with JS to hide them all (except the first) and then reveal them based on the options picked.
whatever is more convenient for you. Not realy software related

Rendering 20 large identical listBoxes

I have an HTML table with rows (20 rows).
Every row has a listbox of countries (about 250 countries) that are filled using a single dataset from the database.
Loading time is quick enough, but rendering time is really a mess.
Is there any way I can speed the rendering of those listboxes?
You could load it only once, and then copy the DOM element everywhere you need it...
I'm not sure if this would improve a lot since it would rely more on the user's computer, but I guess it's worth trying if it's too slow the way it is right now.
edit: here's how I'd do it. Use with caution, I haven't tested it and there is most likely tons of errors with this code, it's just to give you an idea of what I was saying.
<mylistbox id="listboxtemplate"> ... </>
<div class="thisPlaceNeedsAListbox"></div>
<div class="thisPlaceNeedsAListbox"></div>
<div class="thisPlaceNeedsAListbox"></div>
on document ready, using jquery:
jQuery(".thisPlaceNeedsAListbox").append( jQuery("#listboxtemplate").clone() )
You could try to add next select box only after user has selected previous one (using JavaScript).
I'm quite sure that you can rethink the form or the process, but I can't suggest anything specific since you haven't given enough information. For example depending on situation you could use multi-select or some fancy JavaScript widget.
EDIT based on your comment:
Then how about serving the table without selects. And if user double clicks on a country field you change the text element to select element using javascript. And once user has selected the country you can change back to text element. You can submit results back to server using Ajax (after user has selected the country) or using hidden fields a submit button. This way DOM will never contain more then 1 select element.
You can pass countries to javascript using inline JSON object/array (in script tags). To make things even more faster after user has edited the first element, just hide (css: display: none;) the first build select element and clone/move it around each time user wants to edit a row.
As you can see there are a lot of paths you can take using this approach, it all depends how much you want to optimize/work on it.