How to set yes/no value to no in a table on a form load to log out all users - boolean

So I'm creating a ms access database to allow associates to request time off and i need to be able to auto fill a text box based on the user login. that being said, i have a table that has all of the usernames passwords and employee names in it with a yes/no column attached to each user. My question is how can i get the yes/no value to auto set to no when the "login screen" form loads? I want to use the usernames in access not enviorn(username) to get the windows username.

"My question is how can i get the yes/no value to auto set to no when the "login screen" form loads?"
Create an update query that updates the yes/no field to 0 in table Users (usernames passwords and employee names in it with a yes/no column attached to each user)...name it i.e. ZeroUsersQry
then in the OnLoad event of form login:
docmd.setwarnings false
docmd.openquery "ZeroUsersQry"

Related

ChoronoForms v5 dropdown field dynamic preselection

My question is a very simple question:
I want to preselect the single data stored in a previous form in a dropdown field of a form (chronoforms v5).
In other words: In the previous form user has chosen 'New York' from a cities dropdown field.
Next time the user enters in the form he has to see the dropdown field positioned to the city of 'New York'.
Any suggestions?
Thanks a lot
Assuming that your users are registered and logged in them you can save the User ID and the selected value to a database table in the first form; then in the second form use a DB Read action in the On Load event to recover the saved value.

Setting the 'query field' on an InfoPath Data Connection

I'm trying to follow some instructions with the first line:
1) Set the "query field" (Account Name in getUserProfileByName Secondary Recieve data source) to the Account Id of field selected in People Picker.
From here. But when I go try and edit queryfields it's greyed out? Ultimately I'm trying to populate fields when a user selects a user from a People Picker. Any help appreciated.
I'm using InfoPath 2013.
To autocomplete this you'll have to use a support or population-related field, with a new action rule. This is due to people picker fields not allowing any action rules applied to them.
Condition:
Use the condition DisplayName is not blank by using "Select a field or group..." in advanced view and selecting your people pickers field
Actions:
Set a field's value
Field: data connection queryFields DisplayName of people picker
Value: your forms DisplayName of people picker
Query using a data connection: getUserProfileByName / User Information List
Set a field's value
Field: your forms Department field
Value: data fields > Department of your data connection
Please note: getUserProfileByName / User Profile Service Data Connection no longer works in SharePoint Online and results in an error 5566. Please use a SharePoint list data connection to the hidden User Information List on the stem of your SharePoint site instead. It provides you with most of the same fields you'd find in getUserProfileByName, see below:
Name
Account
Work_email
Mobile_phone
About_me
SIP_Address
Is_Site_Admin
Deleted
Hidden
Picture
Department
Title
First_name
Last_name
Work_phone
User_name
Web_site
Ask_Me_About
Office
Picture_Timestamp
Picture_Placeholder_State
Picture_Exchange_Sync_State
Hope that helps!

Increment Id in Sharepoint

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!

Make records "Non-Editable" after certain approving in TCA TYPO3 backend forms.

I have an extension called calendar and it contains a record event. For an event to be displayed on the Front End it has be approved by the admin. But once the admin has approved/rejected it, the record should no longer be editable from the backend.
I want to do something like this :
TcaEvent.php
if ($currentRecord_Permission=='Accept' or $currentRecord_Permission=='Reject')
# Make the current record non-editable
else #make the current record editable
Will the $TCA array contain the details of the current record being edited? If so, I can use it to achieve the above mentioned.
Try to use 'editlock'. This is exactly what you need.
Field name, which – if set – will prevent all editing of the record
for non-admin users.The field should be configured as a checkbox type.
Non-admins could be allowed to edit the checkbox but if they set it,
they will effectively lock the record so they cannot edit it again –
and they need an Admin-user to remove the lock.Note that this flag is
cleared when a new copy or version of the record is created.This
feature is used on the pages table, where it also prevents editing of
records on that page (except other pages)! Also, no new records
(including pages) can be created on the page.
So all you have to do is to set this field to TRUE after admin will approve the record. Or even admin can set that field if the approve means he enter to edit the BE record anyway.
Read more here:
http://typo3.org/documentation/document-library/core-documentation/doc_core_tca/4.7.1/view/1/3/
Find 'editlock'.
Basically you have to define in your TCA waht field in table will be an editlock field like this:
$TCA['tx_address_domain_model_item'] = array(
'ctrl' => array(
'title' => 'Title'
'editlock' => 'editlock',
...
The $TCA is a configuration array and does not contain any data of any records. It just holds the configuration of all fields that TYPO3 uses. There is also not a field which prevents a record from beeing edited except an admin. To achive this, you can create a second page which holds approved records and make this page invisible for non admin users via the permission module. Just set the owner of the page to user admin and group admin.

Password Protect a form in MS Access 2003

I am trying to create a login for my database and I don't want to use the Microsoft way of doing so. I want to have the users login with a username and password then have that information verified in the "tblUsers" table.
UserID LoginID Level LevelID
jpurk jack23 admin 3
krimes kitty editor 2
lwalms low34 reader 1
I got as far as verifying the "UserID" and "LoginID" using dlookup
Nz(DLookup("[LoginID]", "tblUsers", "[UserID] = '" & Me.txtUserID & "'"), "")
=Me.txtPassword
The problem I have now is that I want certain items on the menu unavailable to users without the proper Level; If they are only an "editor" or a "reader", then I don't want them to have access to the "administrative" button where I have placed all admin forms.
After I use dLookup to verify the username and password, how do I now find out their "Level" and assign rights to different menu items? Thank you.
Assuming your DLookup has found an existing LoginID value, you can use another to retrieve that user's LevelID. Then enable/disable the administrative command button based on their LevelID.
I'll suggest something like this in Form Load:
Dim lngLevelID As Long
lngLevelID = DLookup("[LevelID]", "tblUsers", "[LoginID] = " & Me.txtLoginID)
Me.cmdAdmin.Enabled = (lngLevelID = 3)
Notes: That assumes you've previously loaded the user's LoginID number into a text box named txtLoginID. txtLoginID could be hidden if you don't want the users to see it. Or you can grab the LoginID value by some other method.
If you have one-to-one matches between Level and LevelID, you shouldn't need to store both values in tblUsers. You can create a UserLevels lookup table to hold both, and store just the LevelID in tblUsers as a foreign key to the appropriate row in UserLevels.
Finally, the strategy you're using can work, but the security is shaky. As "guidance" to users willing to follow the rules, it's OK. But it can be easily circumvented by even unsophisticated users. Look for a different approach if your security needs are stringent.