InfoPath 2010 NaN - sharepoint-2010

I have been trying to update a text field in a form that will automatically generate a new number in a read only state when a user fills out the form. When the user completes the form and selects the submit button, the form will be attached to SharePoint List and the following user will open the form and the number field will be the number +1. I have used 'count(mynumber)' and the field returns 1, but when I close the form and re-open it, the field still displays 1 and never increases. When I use 'count(mynumber) + 1' the field returns 2 and also never updates. Finally, I used 'max(mynumber) +1' and it returns NaN. I have come to the conclusion that there is an array here, but don't know what I need to do, to fix this.
I have informed my manager of 'InfoPath 2010 Cookbook' so hopefully this will help, but I also took a gander as this following link, which was not easy to follow as I believe its for 2007 instead of 2010.
http://claytoncobb.wordpress.com/2009/06/15/auto-numbering-infopath-forms/
I am using SP 2010.

So, here is the simple approach to the simple request:
•Just like in any database, every item in every list and library in SharePoint has a unique ID. This ID is stored in the ID field, which is available for viewing in any list or library. Go to your list, modify the view, and check the box next to the ID field so you can see what I mean. This ID is 100% guaranteed to be unique and is never duplicated.
•Since you already have purchase order numbers, you can't use the IDs by themselves, however, you can use them to drive your auto-generated Service Order numbers
•The easy method for doing this is to utilize your SO field, which is now a Number field, and determine the differential between the next ID in the list and the next Service Order number that needs to be created.
•Then, create a simple workflow in SharePoint Designer 2010 that ONLY runs on the creation of a new item (only runs once per item/form), and set it to add the differential to the current item's ID (Something like Do Calculation: ID + 1200) . Next, use Set Field in Current Item to set your SO field to the variable created by the Do Calculation step
From then on, you will always have a GUARANTEED unique, auto-incremented SO # for each form, and you should make this field read-only inside the form so that users can only view it and not edit it.
--Clayton Cobb

Related

My recordset returns only one record even though there are more one record in Microsoft Access

I am creating a form that loads all the information from the Activity_Table into the form. So basically when the user chooses the name of the Company from the Company_Name drop down, and selects the site from the Site_Name combo box, it is supposed to return the values from that site and put them into the form.
Basically one site can appear more than once in the Activity_Table. Yet, whenever the user selects the name of the site, it only returns one record. To make sure of this, I used the .Recordcount method to check how many records that will be retrieved.
So when you check the Activity table, the Site "Accra Mall - 630kva Gen 2 " appears 4 times, yet when you check the recordcount, it only says it appears Once. So because of this, I cannot move either forward or backwards to either the next or previous record.
To make sure that there was nothing wrong with my sql, I run the query in the Query Design and it produced all 4 records of "Accra Mall - 630kva Gen 2".
So there is nothing wrong with the sql statement. Can anyone help me out please?
This is when I choose the name of the site
We can see that it returns only One record here
Yet this is the amount of records it's supposed to produce(This was when I tried the sql code in the query design tab. It returns 4 records, Not 1). So the recordcount is supposed to be 4. Not One.
this is when I tried the sql to in the previous picture.
If I replicated your problem correctly then the answer is to set Data-Entry to no. Check your form properties. Under the data tab there is a data-entry property. set data-entry to no. From microsoft at https://support.microsoft.com/en-us/office/dataentry-property-f4236759-27f6-4fcd-abb0-4aa4acd8fe87 we get an explanation:
You can use the DataEntry property to specify whether a bound form opens to allow data entry only. The Data Entry property doesn't determine whether records can be added; it only determines whether existing records are displayed. Read/write Boolean.

How do I add an auto-populated form record (created from another record) to a table in access?

I am populating a form with information from two other forms to create a new client record. From form 1 I get the CaseID which will tie the new client record back to the Case table. Form 2 lets me select a client from a list and pull information for some fields into the new record. These data populate Form 3 which appears to show a new record (then number at the bottom of the form is 1 more than currently exists in the table) But the ClientID field is blank - this is the unique key for the client records table. I cannot seem to get this field to increment and thus can't get the record to save to the table.
Based on various searches I've tried forcing the record to save but nothing happens... no errors nor new records. I've tried
If me.dirty then
me.dirty = false
end if
and
DoCmd.RunCommand acCmdSaveRecord
I assume I'm simply not truly initiating a new record even though the form suggests it is being created. What is the appropriate way to add the record, including which control I need to use to initiate the action (e.g., attach to the On_click() event of a button). Note that, sometimes the record will be perfectly fine as populated, and sometimes the user may need to edit one or more fields before saving the record. It is also plausible that occasionally a user will decide the record should not be added and thus will need to close without saving.
It turns out that the ClientID field in the test database I was provided is NOT an autonumber field as it will be in the live dB version. So I simply had to look up the max value in the table and add one. I will have to test the autoincrement when I get the true Dev environment set up with the actual database structure duplicated instead of the mockup I have been working on to create the work flow.

How can I jump a form to a specific record in Access?

I have an Access Form which pulls records from a table. The user will interact with the records, sometimes in chronological order, and sometimes by jumping direct to a specific record.
The table uses a field called ID as the primary key which auto-numbers when a record is created. This is what the team will use to jump directly to a record.
I need to create a textbox where the ID number can be inputted and then a button to carry out some code to jump to the specified record if it exists.
I have attempted to put bits of code together what I have found online but so far have had no such luck in making anything work.
I would be very grateful if anybody could advise me and provide a code sample to make this work! :)
Make use of the RecordSetClone and Bookmark properties.
Use the RecordSetClone property to obtain a copy of the form's recordset that you can manipulate without affecting the "live" recordset used by the form.
Locate the appropriate record in the cloned recordset (perhaps using the FindFirst method), and obtain the Bookmark which uniquely identifies such record in the recordset.
Set the Bookmark property of the form to the Bookmark value obtained from the cloned recordset in order to change the current record displayed by the form to the record found.

Infopath 2010 - Create a repeating block from each item in an array on form load

Please forgive me if I don't explain this well. I'm new to Infopath. Here goes!
Overall Goal: Create an infopath form that will generate an email, eliminating certain 'human error' problems that we've been having.
Problem: Automatically creating a new repeating block for each item in the list/array.
The list would be something like:
PROPERTY NAME = Prop 1, Prop 2, Prop 3, etc.
Below is the entire block of data that I want to repeat.
*PROPERTY NAME* – OPEN or CLOSED
Hours – XX:XX AM ET – XX:XX PM ET
No incidents open
IMxxxxxx - Incident details | Status: Red
This entire block needs to be repeated for each property we own. Now, while I know that I could create multiple blocks for each property manually, that makes creation and maintenance of the form time consuming . Ideally, I'd like the form to read the property's from a list or array, and insert the name into each new block when the form loads up. The rest of the info would be filled out by the user of the form. This way, if we ever add or change a property, I or someone else can easily update the form by simply adding the new item to the list/array.
I have been Google'ing this for hours today and I think my problem with search results boils down to my lack of knowledge of the proper terminology.
Does anyone have any ideas?
Create a secondary data connection to the source list (where does it live, BTW? SharePoint? SQL?) Drag the data node for the secondary data connection onto the canvas as a repeating section with controls. Remove controls you don't want to see and arrange the others to your liking.
Upon form load query the secondary data source. The repeating section will then be populated with the items returned by the query. This will only read the items, though.
If you want to edit the items, then you need a repeating group in your main data source. After querying the secondary data connection, you need to copy the data from the secondary to the main data source. Edits can be done in the main schema, and you will need a submit data connection to write back the changes.
This is not out of the box InfoPath functionality but it can be done with code or with 3rd party tools like Qdabra Software's qRules.

Access Query not updating fast enough

Im building a key inventory mgmt system. I've created a query that show's me keys currently not in use by identifying which keys have been returned, aren't lost or have never been rented. I copied this query into the look up field for key_id in my keyActivity table (used to record key sign outs). The issue is that the query does not update to provide available keys until the table keyActivity is closed and opened again
Example: I open keyActivity, indicate that key_id = 5 is lost. When I go to a new record and select the key to sign out, key_id = 5 is presented as being available. It is not until I close the table, open it again, that key = 5 is removed from the list.
Here you can see key 5 is indicated as lost in id 5 but in id 7 when selecting a key, 5 is available when it shouldn't be.
Is there anyway to fix this or set this up to work as intended. I plan on using forms to present all the information. Is there a form solution perhaps?
The suggestion you would be better off with a Form to change table data. It can be easily requery-ed to update the table according to the changes you make and to display the udpated data accordingly. Please also read on the given references for further info.
In terms of data updating and locks in a multi user environment this article could be helpful.
"Access is NOT a database server. It's a desktop database. It has been pushed to the limit to support mutli-user environments, but only in the sense that you can share the "back end" database across a network."
...
...
"Even the record locking is performed by the Front End. All of the front end
database applications share the "lock file" (a file with the same name as
the database file, but with the extension LDB); but that file is simply a
mechanism that the front ends use to determine which front end can make
changes to the database."
....
Here is a difference between requery and refresh:
Me.Requery forces the entire recordset (underlying data) for the form to reload. This means ALL of the records in your current form will reload. Your current position will be lost, so if you're sitting on record 10 of 100, you'll find yourself back on the first record. Me.Requery is essentially the same as closing and reopening the form. Any new records added by other concurrent users will be available. Likewise any records that have been deleted will disappear. Requery essentially "re-runs the query" that pulled the data into the form in the first place. You can also use requery to update the data in a list box or combo box.
Me.Refresh saves the current record that you're working on. It will also retrieve any changes (but not additions or deletions) to any records shown in the current form. Any calculations on the form (unbound fields) are recalculated. Refresh does NOT reload the recordset. You do not lose your position in the form (you stay on the current record). Any new records added by other users will not be shown.
Reference
MS Access - Write to Table Immediately After Changing Value in Form