Increment Id in Sharepoint - forms

I am trying to increment an Id in a Sharepoint list.
I have tried different settings in the online editor of Sharepoint under "Settings > List Settings > Edit Column > Calculated Value".
Another option I tried was to create a custom add form using InfoPath.
In this custom form, I added a rule on my field contactId. The rule has two actions.
Create a Query to the Contacts table
Set the current Id equal to (the maximum idContacts + 1)
enter image description here
A thirth option I tried is to set a rule under Submit options. That way I thought when I submit my form it will check if idContacts is currently blank. It will Query the Contacts table, set the current idContacts as the (maximum idContacts + 1) and finally submit the data to my table.
enter image description here
Finally When I submit my form it gives a pop up message "Connecting to Server" then it redirects to my list but nothing is added to the list.
Does anyone know what my problem could be. Or does anyone know a proper way to do this. I already lookup up a lot of tutorials and other information but I can not find it.
Thank you in advance!

Related

Update form in access when form is not open using VBA

I developed a form in Access that allows users to search for records that match their parameters. The form has about five combo boxes that contain values which a user can search. A query is set up that pulls the values from the combo boxes. An associated form, "F_FilterResults", lists the results of the query as a datasheet that display the results of the search. I created an AfterUpdate event on each combo box on "F_FilterResults" so that after I update the combo box with a search parameter the query and form would refresh itself. Here's some sample code from the AfterUpdate event in the combo boxes on "F_FilterResults".
Private Sub CompanyState_AfterUpdate()
Forms![F_FilterResults].Requery
Forms![F_FilterResults].Refresh
End Sub
This only works however if the "F_FilterResults" form is open. When it is closed I get Run-time error '2450' message that indicates that the "Microsoft Access cannot find the referenced form 'F_Filter.' How can I have this code run when the "F_Filter" form is not open? Note I do not want the form to open right after you select a search parameter from a combo box since the user may want to add more search parameters to the other combo boxes. If I program "F_FilterResults" to open on loading the search form the user may X out it and would not know what the error message means.
You can open a form hidden. That is the "easy" answer. However the need to do this means that the way you go about achieving your result is not the best.
The way I would do it is that instead of updating a form that pulls values off the combo boxes I would generate a string that can be applied as a filter to the form when it is opened.

How do I search though related tables in access and have the results displayed in a list box

I have created a form that searches through a table, following the instructions of John Big Booty, as can be seen here: https://access-programmers.co.uk/for...d.php?t=188663. The search form has a list box that has a query run whenever a text box is changed which allows me to search fields in one table but how do I adjust it to allow me to find related records stored in a second table. The database stores widow information and they are looked after by legatees.
The query has the following code in the criteria for each field you want to search Like "" & [forms]![FRM_SearchMulti]![SrchText] & "".
Each legatee is responsible for looking after multiple widows and any widow can be assigned to any legatee but any widow can only one legatee when she is assigned to one.
The search form is called FRM_SearchMulti and it searches through the widow table as I type. I want it so that you can type in a legatee and it will display the widows that have been assigned to that legatee typed in the search box. I seem to have hit a road block and everything I try doesn’t seem to work.
I have uploaded a version of the db with a lot of the information deleted, for privacy reasons, so if it is possible, could you describe to me how to do it and I will update the file with all the information in it please?
Any help would be greatly appreciated.
Thanks,
Dave

Getting current item ID in SharePoint Infopath form

Can we get the current item ID value while submitting the data in InfoPath form.
I need to use this and concatenate the ID with other field value. Tired "Max(#ID) + 1" function but it wouldn't solve the problem.
I know it can be done using calculated column or workflow.
It needs to be done using InfoPath form ? Is it possible ?
You already figured it out yourself. Im assuming you are trying to use the ID in naming it.
Create a blank field.
Then add that field to your submission naming concat.
Create a receive data connection (assuming you havent) to that library.
On the Submit rule add the query action to that library and a set field action to set that new blank field with max(ID) + 1. Make sure Submit action is last.
That should do it unless Im missing something as I have used this many times!

MS-Access: How to create form where user can add results (tblResults) to a tests (tblTests)?

I am creating a database that contains Product information (tblProductInfo), a list of test methods (tblTests), and the results that the product gets (tblResults).
I'm adding forms so that a user can enter the results of a previous or new product. This information will be added once all the testing for that product is done. So, I would like to be able to show a list of the tests from tblTests, and have the user enter the results in a text box of some sort displayed directly next to the tests. I can't figure out a way to do so, where it will then save all the results that the user entered.
I have created a form with a subform, where the subform shows the 2 columns (tests and results) and when I change it to allow DataEntry, it gets rid of all the test names. I need it to keep the test names displayed, but allow entry in the results column.
Any ideas?
Below is a screenshot of an example of what I would like, although I need the Results column to be empty.
Create a continuous subform with only the tblresults as the recordsource, and for the header or each field of results use the related test as the label is how I would do it. Set allow additions to yes, allow edits to no allow deletions to no.

Unable to get form to open to an existing record

When my application first opens, I have an Autoexec Macro set to open a small form (frmGrantNo) in a window that asks for a grant number, the field for the grant number opens blank (Data Entry = On). This works.
Next I want to manually enter an existing Grant Number from my table (tblGrant), and open another form (frmInfo) to the grant number I manually entered.
So far, if I manually enter an existing Grant Number, I can’t get it to take me to that record in the frmInfo form, it opens to the first record in the table.
I have tried a Button Wizard for a Go To Record Button and I get the error “The command or action “Find” isn’t available now”.
I have tried a macro that opens the table (tblGrant), then Got To record, then Open Form (frmInfo) and it opens the table in datasheet AND the frmInfo Form, but to the first record, not the one I entered.
I have tried event procedures that I found online, but none of them work as I still don’t quite understand more than the basic VB commands.
I have looked here for help but I may not be working my questions right becuase I haven't found anything to help.
Any help would be greatly appreciated. ~ Thanks
You want something like this:
DoCmd.OpenForm "frmInfo", WhereCondition:="GrantNumber = " & Me!GrantNumber
in the button event procedure. It filters the opened form to the grant number you entered. Adapt field names for your table and form.