Access ID update when using tickboxes - ms-access

I'm running this hotel database where in the pool there are 3 ID's in which people may have asked for a towel, asked and given it back, and not ask at all.
I'm using checkboxes to change the ID of the situation, but when i use the Checkbox, it updates the ID information and doesn't change the ID itself.
What should i do?

Don't use 3 independent checkboxes. Options to consider:
combobox bound to field where data must be saved
radio buttons in an OptionGroup frame. Presuming the status indicators are 1, 2, 3 all you have to do is set OptionValue property of each radio button and bind frame to field where data must be saved.

Related

MS Access - searching for better method to create and edit records

I have made a database that I use at work for tracking tags that get signed out. The way I currently have it is I created a table that has 100 records manually entered already. Field Name "TagNumber" 1 to 100. There are several other fields for every record that is currently blank.
A user will have access to a form that they will select a tag number from the "TagNumber" dropdown list. Doing this will allow them to fill in the other fields with the correct info for that tag. When finished they will click a save and exit button that will modify that record they just put the info in for. It will also update a Field named "SignedOut" it is a data type Yes/No field. Once the user has signed out that tag number it will no longer show up on the dropdown list when someone else goes to sign out a tag.
On the same form there is a "SignIn" dropdown list that only shows the tags that are checked yes in the "SignedOut" Field. When a user selects a tag to be signed they enter their name and date and click save and exit. Clicking the save and exit button will run a macro that copies all the data on that single record to another table for tracking purposes. It also sets all the fields back to blank except the "TagNumber" field. This allows another user to sign out that tag again.
examples of my tables:
Nothing signed out yet
Tag 4 signed out
Now my issue I am running into is If I provide this to another section they have different tag numbers and I don't want to have to go to the table and physically change every tag number. Is there a way I can auto populate the list with different tag numbers? or is there a way I should be doing this that is completely different from the way I am doing it?
Thanks for any info you can provide.

Checkbox per row in multi user access database

I have the following situation:
I have a many to many relationship.
For example an Employee Table, an Course table, and an relation-table inbetween.
Now I want that the user can select out of the course table his courses in a dialog form.
That means that the underlying table for my continous form inside the dialog is the course table.
I want a checkbox in every row which indicates if the course is selected or not.
As I read it is not possible, to add an unbound checkbox, because they are just copies, and a select click would select all of them.
The solution would be to add an yes/no field to the underlying table courses.
But here I have the problem as I understand the matter, because I have several users using the database at the same time, that the underlying table will be updated if I click one checkbox and this update will select the value for all users which are using the dialog form concurrently, what I dont want.
So my question is, is there another solution to get a working checkbox per row in a multi user access database.
There are two solutions which I could imagine:
1) The underlying table will be the relation table and in this every possible combination between employee and course will be saved together with a yes/no field. (but that would be from a data view point quite horrible)
2) If the changes to a checkbox would not be directly written back to the database table, I could discard them on saving and manually insert the relation records in the relation table. (Is that possible?)
Thanks for any solution proposals
I see two good approaches:
1) This assumes that your database is split in a network backend + each user has a local frontend. This is the recommended setup for multi-user.
The frontend has a local table with Course_ID and a yes/no column.
A join of this local table with the Course table is the recordsource for your continuous form.
On loading, you copy the course ids into the local table, and set the existing relations to True.
On saving, you update the relation table.
2) Use a ListView control instead of a continuous form. It has inbuilt checkboxes. Loading and saving is done with a VBA loop.
Based on your description I assume your form has a LEFT/RIGHT JOIN in its data source where some ID field is null if the specific Course/Employee combination does not exists in your relation table. Let's call it LinkID. Then your checkbox should be something like =NOT ISNULL(LinkID). While you will not be able to use the OnClick event for the user to check/uncheck this way, you can use the onMouseDown event to see if the user clicked the checkbox and take action accordingly.
That way you don't need an "all combinations" relations table, no temporary table and no Yes/No field. If a record with the Course/Employee combination exists the box is checked, if it does not exists, it is not checked. Adding and removing courses is done by adding and deleting records from the relation table.
Have a look at this How to use unbound checkbox in a Continuous Subform - MS Access. A class that binds an unbound checkbox. Better than listbox, because you have a form with all its benefits (sort, filter, edit, append).

Access 03 Parent and Child linkage issue

I have an Access database (2003 Access) that has a main form linked to a table (tblClientMaster) and a series of subforms. TblClientMaster has a series of unique client names. You can then click on each subform (there are labels with each name that can be clicked on which will open the subforms) and they should filter based on the client you have selected on the main form. I can't filter the subforms based on additional criteria, but I've basically given up on this for now (filter the subform results based on the value of a field on the main form along with an additional parameter, like product name. Every attempt I've made has utterly failed and posting questions on here about it generated no responses, so I've abandoned this for now.)
I am focusing on getting a single subform to work right now (fsubBenCalcs). Each record of the tblBenCalcs has the name of the client which matches the client name listed on tblClientMaster. When you click the BenCalcs subform, it filters the results by client and you can cycle through each record that exists with the same client name. (for instance, Company ABC has 25 calculations that have been completed. Once you select Company ABC, you can click on the BenCalcs subform and it will display the first record and you can cycle through the other 24) However, when I open the main form, it asks me to enter the Parameter value "tblCalculations.Forms!frmMain!ClientName".
First, I don't understand why it is looking for tblCalculations.Forms when tblCalculations is a stand-alone table containing the data for fsubBenCalcs. Second, when I load the main form, it should be completely independent of any value on fsubBenCalcs. Only when I load fsubBenCalcs should it look to the main form for the name of the client.
On the Subform/Subreport (when I go into properties on the main form and find the BenCalcs subform) it has the fields "Link Child Fields" and "Link Master Fields". For these, I put [Forms]![frmMain]![ClientName] for Link Child Fields. For Link Master Fields I just have ClientName.
I have to imagine something is wrong in here, but I haven't been able to come up with the correct way to link these forms. I would appreciate any help or guidance on this. I hope I was clear enough in my description.
Subforms (child) must link to the main form (parent). Subforms are not designed to refer to each other in a partent-child relationship.
You can hack this as follows:
Put a text-box on the main-form (i.e., NOT any of the sub-forms) with the following control source:
=[subForm_1].[Form]![FieldYouWantToLinkBy]
Then, in your "child" sub-form, use the parent-child linking fields to refer to this textbox.

textbox in continuous form populated from different table

I have a continuous form in an access 2010 database that outputs a separate row of data for each customer from a customers_table. The continuous form is for data display only, and no data entry or editing is allowed. One of the textboxes on the continuous form is populated with data that was entered using a combobox in a different form used for data entry. In the textbox on the continuous form, enabled is set to no, and locked is set to yes, so that the textbox is not editable in the continuous form. However, in the separate data entry form, the combobox entered the id for the selection the user chose, instead of entering the text. Therefore, in the continuous form, only an id number is shown, when the user needs to see the text of the specific option which is encoded in that id number.
I think I want to keep the id in the customers data table, in order to retain freedom to make subtle changes in the combobox options later.
So how do I modify the textbox in the continuous form to populate with the textual value associated with the id number? This would seem to involve some sort of SQL like:
"Select textValue FROM comboboxsource_table WHERE comboboxsource_table.ID=textbox.Text"
However, I have no idea where to put this in the Access GUI. The Control Source field in the Data tab of the property sheet for the textbox does not seem to allow this sort of syntax.
If you're not editing the data, put a query behind the form instead of a table. Then, just pull the field you need into the query and VOILA! Problem solved. :o)

Multiple radio buttons naming problem

i have a bit of logical problem here. I have a catalog of products that have unique ids and options that are displayed to the user through radio buttons. Now my problem is that a user must be able to select different options (from different products) and to submit them to a PHP script that handles this request (via POST). The problem is that the listed products are in one form, and to be able select multiple radio buttons i have to make them with unique names (and to handle the posted choices i have to guess the name of the button). Is there a way to make all the selected choices into array or something, cause otherwise i have to guess the POST-ed field every-time. I need to just pass the id and the options related to him, so i can extract the information from DB.
And one more what is the most convinient way to store selected choices through multiple pages (a.k.a paging - loaded through ajax) - cookies or temp variable.
Sounds like you should be using Checkboxes rather than Radio buttons - if you want multiple selection
I agree with barrylloid.
then, if you name all your checkboxes something like
product1_select[]
then you should be able to read the values of the selected boxes in the PHP backend using
$_POST['product1_select']
Good luck!