How I can add a row and input field on button click in lotus note 8.5. form? - forms

I have question about Lotus Note. I have form: http://i.stack.imgur.com/YWii6.jpg
In this form I need create bottom. With this buttom user can add new row with input field in this row to existing table. I find that kind of lotusscript from:
http://www-01.ibm.com/support/knowledgecenter/SSVRGU_9.0.1/com.ibm.designer.domino.main.doc/H_EXAMPLES_ADDROW_METHOD_RTTABLE.html
But when I this script copied to this form, I get error "Object variable no set"
Then I tried this solotion:
LotusNotes 8.5 - Adding a row to a table with a button
And I again get the same error.
Can anybody tell me please, how I can create new row and input field in this row, when I pressed buttom "Add row"?

You can't make a table with a dynamic amount of rows in a Lotus Notes Form. There are two common ways to solve this:
Use child-documents; one document for each row; and show these documents using an embedded view. This is the most elegant imho.
Create a large, fixed-elements table, and hide the rows that are not needed (for instance, by checking the presence of an input in the preceding row. This is OK for small amounts of row, but performance starts getting bad if you have too many rows.

It seems you are a bit confused as to the difference between a form (your picture) and a document (the code you link). Also, you definitely need to understand the meaning of "Object variable not set", which is the most common error when you use Lotusscript.
Anyhow, where to go from here depends on how you plan using the data once it is input. Will it be edited ? Will each row need to be handled as a separate record ?

Related

Updating slickgrid autocomplete fields without rerendering the grid

I'm using SlickGrid in a sharepoint environment to display and update data. To save on the the load time, I am populating auto complete fields with options that have only been used in previous lines (with tables with more than 50 lines), and then I am wanting to give the user the option to click on a "Metadata refresh button" located at the top of the autocomplete fields that will go and fetch all available options to repopulate the auto complete field.
<table><tr><td>[ TextField ] </td><td>[ AutoComplete1 ] </td><td>[ AutoComplete2]</td></tr>
<tr><td>Entry1</td><td>Hello</td><td>Goodbye</td></tr>
<tr><td>Entry2</td><td>Hi</td><td>Later</td></tr>
</table>
So if, the user was to create a new line, they would have the options of Hello and Hi in column 2, and Goodbye or Later in column 3 to choose from since they have been used before. If they want the option "Hail!" to appear in column 2, they would have to click the "Update MetaData" button for column 2, which would refresh ALL the cells in that column with all available but previously unused selections.
I know its not ideal, but its a requirement that has been given to me.
I know how to add buttons to column headers and I am updating the array of data that the grid needs for the autocomplete column, but I am at a loss on how to update the column choices without redrawing the whole grid.
Any suggestions?
Check out the newer examples in my repo: https://github.com/6pac/SlickGrid/wiki/Examples
This is probably closest to what you want:
http://6pac.github.io/SlickGrid/examples/example-autocomplete-editor.html
What I have done in the past is create a data property of the cell node to store the object, like:
$jqacContainer.data('queryautocomplete', jqac);
It's then easy enough to get the object from the cell node.
However, this requires proper cleanup of the property to avoid a memory leak. This should be able to be done in editor.destroy(), but I don't think I've checked corner cases, for example where the editor is scrolled offscreen before being completed.

Access Form won't accept input in text boxes

So I have a form in Access.![acessform1][1]
Here are form properties
I got this database and have been making adjustments to the other forms. I gave the database back to the user and they reported an issue that this form is not acting properly, and the add order record function is not working anymore.
There's an Add Order Record button on the right side of the form that would usually add the record if the user manually entered input into some of the boxes. The old form you would have control of the values 1/0 for yes/no. You can enter text into the notes boxes.
This functionality doesn't work anymore, and I can't seem to figure out why. The form is identical to the original and no adjustments have been made except to the table that it pulls data from.
So the symptoms are:
User input is not accepted in text boxes.
The find CP functionality works with the drop down and reflects the records accurately but I cannot update the fields.
Also, the fields CP_Ref and Invoice date don't let me enter data anymore.
Also the Add Order Record was giving me an error that The it could not find the record specified, but I since copied the original form back into place and that error went away.
I think functionality wise this button should save the record after a field is updated and should add a new record.
Seems like all the controls are locked on the page.
Here is the query that pulls the data when I click the button that takes me to the Order form.
SELECT DISTINCTROW CPOrders.Cust, Customer.NAME, CPOrders.CP_Ref, CPOrders.Slsman,
CPOrders.Date_opn, CPOrders.CPSmall, CPOrders.InvIssu, CPOrders.InvNo,
CPOrders.InvDate, CPOrders.DueDate, CPOrders.ETADate, CPOrders.Closed,
CPOrders.Cust, CPOrders.Name, CPOrders.BuyerRef, CPOrders.ToCity,
CPOrders.ToState, CPOrders.ToCtry, CPOrders.ToPort, CPOrders.Supplier,
CPOrders.Origin, CPOrders.Product, CPOrders.GradeType, CPOrders.NoUnits,
CPOrders.Pkg, CPOrders.Qty, CPOrders.TotSale, CPOrders.TotCost,
CPOrders.GrMargin, CPOrders.[Sale$/Unit], CPOrders.[Cost$/Unit],
CPOrders.OceanCost, CPOrders.OceanNotes, CPOrders.BLadingDate,
CPOrders.USAPort, CPOrders.FOBCost, CPOrders.FASExportVal,
CPOrders.InlandFrt, CPOrders.CommodCode, CPOrders.Notes,
CPOrders.ProjCust, CPOrders.ProjValue, CPOrders.ContainerNumber,
CPOrders.Vessel, Customer.TERMS
FROM Customer INNER JOIN CPOrders ON Customer.[CUST_#] = CPOrders.Cust
ORDER BY CPOrders.CP_Ref;
I ended up checking several locations for the answer to this.
What it ended up being was a primary key issue.
Essentially when I got the updated database I put them into new tables, effectively destroying the dependencies, relationships, and established keys.
I reverted back to the old tables and found out the form worked properly.
The issue ultimately was that the primary keys were not defined as needed for the table to be updated.

Access comboxbox selection needs to change value in label control

On a form, I have a combobox, with the RowSource coming from a query (specifically, a calculated field in the query). When the user makes a selection, I want to update a label on the same form with a different column from that same query, but of course associated to the selection.
I'm fine with VBA and writing queries and whatnot, but I am not very familiar with Access forms.
By the way, I tried searching for an answer to this, but it was quite difficult because I don't know what this thing is really called that I am trying to do. A good link to a site explaining this would be perfectly fine (no need to write a bunch of stuff here if it already exists elsewhere).
In the After Update event of my combo box, cboUserID, I can set a label control, lblFoo, to the value of the second column in the selected row of the combo.
Me.lblFoo.Caption = Me.cboUserID.Column(1)
If your combo box is bound to a field in the form's record source, you may want to do that same operation from the form's On Current event also.
You can use the column property to refer to anything other than the bound column of a combo.
Rowsource: SELECT ID, SName, FName FROM Table
Me.MyCombo.Column(2)
This would return FName.
-- http://msdn.microsoft.com/en-us/library/aa224084(v=office.11).aspx
Me.MyLabel.Caption = Me.MyCombo.Column(2)

Inserting rows in form datasource, insert is OK, rows are not visible

Basically, I want to insert rows in the form InventJournalTransfer. I added a menuitem button that calls a class which opens a dialog where I fill a WMSLocationId, then I loop on Inventsum table to get all ItemIds with Available qty for this WMSLocationId and insert them into InventJournalTrans Table.
The code I wrote seems to be working as I have correct records inserted in my table(visible in Table browser, correct journalId, linenum itemId, qty etc...) BUT the records inserted do not appear in my form. I tried to refresh my form with or without code, but my grid's still empty.
I had a look at the class InventCountCreate that does what I want to do in a different journal type, but as I'm quite a newbie it is difficult for me to understand exactly how this class works.
Could anyone explain to me how to display my inserted rows in my form or give other leads?
The InventJournalTrans is table is inner joined to two InventDim, one related via the InventDimId field, the other via ToInventDimId.
Both fields must be filled with a valid InventDimId to an existing InventDim record for the form to show the record.
Have you tried right-clicking on your form's node in the AOT and clicking "Restore"? Perhaps your form is still using cached data.

One (probably unbound) Access 2003 form to create multiple records

I've been recruited to work on a form for tracking specimens. Each specimen is associated with a subject; each specimen also has a particular slot in a 9 x 9 storage box. For ease of data entry, I think it would be best if the Access form mirrored the box itself (and the paper forms that will be used to enter data into Access): nine columns by nine rows, with each element consisting basically of a text box for the specimen ID. This is basically how I'd like it to look:
So the data entry person would essentially type in the box number and specimen IDs, then click "Create Records" to pop all of those records into existence (you can see some other stuff going on here, but that's not really important right now). I'm not really sure about the best way to code this, however. Right now, the best process I can think of is to: 1) run an insert query to create the box if it doesn't exist, 2) run an insert query to create the subject (person), if it doesn't exist, and 3) run an insert query for each specimen, hard-coding in its row and column (e.g. box_col = 'A', box_row = '1').
Note: the subject ID and specimen ID would both be parsed out of the ID field - it's goofy, not my idea, but that's how it's set up. I can handle that, though.
This is a certainly a kludge, but I'm not sure what else to do and most of what I've googled up hasn't been pertinent to multiple-record creation from a single form. Is there a better way to do this? Should I simply abandon the idea and go with a more traditional bound subform approach?
This could be all done in a sub form - however, I assume for simplicity (less clicks, easier user experience, and intuition) you've designed it so that the end user sees everything he /she need to enter. There is nothing wrong with doing it this way. Once the data is all entered just have a button on the form that does the multiple inserts at once.
Start at 1 and include 9 iterations each time issuing a new INSERT statement.
Once the statement has been completed I would personally put a little check mark next to each row so that if an insert succeded it would check it true, else false. You could be nifty and use a green image / red image. After it has completed the process all fields should be cleared allowing additional entry.
I don't see an issue with what you have.
FRIG. I just lost ten minutes of typing. This is why I don't care for web based forms. Although to be fair this is the first time this has happened on StackOverflow.
Do you really need to view the data later in the same format as it's entered. If they can just view regular subforms that's at least half the work as you no longer need to do updates of this form.
Also note that there is a lifetime amaximum of 768, if I recall correctly, controls per form. 9 x 9 x 2 is 162 so you'll be ok there. However if you decide to delete and recreate lots of cotrols you could be in trouble. If you do hit that limit I think saving the form under a separate name should reset the counter.
Note you can use the following construct to refer to controls and make life easier.
Me.Controls("abc" & Row & column)
For example in the After Update of the type control you could use
call InsertRecords(3, "B")
sub InsertRecords(row as integer, Column as string)
....
cboTypeValue = Me.Controls("cboTypeID" & Row & Column)
....
This could be used as some kind of native access controls only grid.
If someone would post an example of how to create custom unbound subform with row for each unbound record and a code to loop and save it to the tables would be just great.
There wouldn't be as much controls and it wouldn't have any limits by the numbers of fields on form.