Access Userform Value field list issue - ms-access

Hi, I have almost 40 yes/no questions, so I have created the form using the table "data", each field in data table I selected"yes/No" data type. Now after completing the form creation, when I select first question or any of the question as yes/no , rest all of the questions getting no selected. Is this something can you help me with?

Yes/No datatype usually set to No as its default value.
There are two type of controls you can use on form to represent Yes/No data type: option and checkbox.
If the control is bound, it will shows its field default value on current record which is 'No'.
In your case, i prefer to use unbound controls and vba to manage form interaction and save answered data into table.

Related

MS Access multiple default values for one field

Building an ms access data base. I have one field called form type.
I have 4 forms pulling from this field. Currently I have a drop down stating Internal, External, Other, and Cases.
My co-workers select the wrong drop down item for the form they are using.
Is there a way to have multiple default values for a single field?
Or can the field be auto filled when submitted without the user selecting anything?
I tried no default value with a data validation drop down list. I have searched the web for alternative methods with no avail.
My expected result would include the form auto selecting the correct "Form Type" for the field. This way there is no user error.
Thanks for taking a look, Matt
As you have four different forms using the same table-field, you can put a different default value in each form for this control:
In the design view of each form select the combo box and then, if not already done, open the Property Sheet (e.g. with key F4).
Then put the proper default value in the property Default Value and you're done.

Updating a non-bound field in a form with a record source

I have a form with a record source of SELECT [AccountRunInProgress] from [AccountRunSummary]. The form contains a text box with a date which is used to apply a filter on the above record source, based on the month and year (defined as two separate fields in the AccountRunSummary table).
The other field in the form is a check box bound to the AccountRunInProgress field. When ticked, the OnClick event for this box updates a date field called RunProgressStartDate in the AccountRunSummary table with the current date and time.
I then get a Write Conflict error when closing the form - almost certainly because I am trying to update the table via the OnClick event while using the table as the record source at the same time, despite not binding the date fields. The date is updated in the table but not the boolean.
What is the best practice for working around this? I thought about adding RunProgressStartDate as a hidden bound text box in the form and adding it to the record source, but I'm fairly sure that will cause more problems rather than less.
You are on the right track.
You can't edit a record through the bound form and with an Update query (in VBA) at the same time.
IMO the best solution is indeed to add RunProgressStartDate to the record source and as hidden control to the form.
Then (important!) set the value of this control in the OnClick event, don't write the table with an Update query:
Me!RunProgressStartDate.Value = Date()
and both fields (checkbox and date) will be saved when the record is saved.

retrieving data from a query inside a form

I have a form in MS access which contains information about customers of a store (It's directly connected to the table because I want to be able to edit fields).
I want to have a field inside the form which contains information calculated in a query in the form of (ID, Value)
How is it possible?
Derive data using either VBA or Macro
Since your form is bound, and the field in your query is not a field in the bound table, you can simply add an unbound control to your form. You can use a textbox control, draw on form, and it should default to an unbound control. To check, select the new control and confirm that its control source property is blank.
I am assuming that your query already has form references that are filtering the results based on which record you have open on the form. If not, you will want to put in the ID field's criteria of your query: [Forms]![MyForm]![MyBoundIDControlNameOnForm]
In your form's On Current event. Open the code builder and type this into the On Current event:
Me!txtMyNewControlName = DLOOKUP("[Value]", "MyQueryName")
DLOOKUP has a third argument that allows you to add criteria. I am assuming that your query only returns a single row with the form reference criteria, so there is no need to tell DLOOKUP which row in the query results to return.

Access form must be opened twice before combobox values will appear

I have a checklist that is used to perform QC audits. When a reviewer answers a question that requires an exception, a pop-up form will open with the correct exception detail already populated. They then have to provide some further information, which I have set-up in the format of a combobox for a field named 'Condition_Detail.' Some exceptions have only one condition that would be an option in the drop-down whereas others have multiple possible conditions, which is why I don't have that field automatically populated as well. I have a table of possible exceptions and conditions that I have used to create the combobox query. When the database was created, the field the 'Condition_Detail' combobox is dependent on was labeled 'Exception Detail' with a space and in my new table it is called 'Exception_Detail.' I did this because the old data and tables will eventually become irrelevant and I know that it is easier to write code with underscores instead of spaces. I include this information because I had to create a relationship between those two fields in the combobox query so that the database would know they are the same. When I test the database, the form opens as expected with the exceptions already populated (NOT in combobox format - the data appears as text on the form). The issue is that when I select the combobox, it is blank. If I answer the exact same question the same way to trigger the same exception to open in a new record, the combobox does have the correct data in it. I have tried to requery the field both when the form loads and after it updates. It still won't show the combobox values unless I trigger that the form open twice with the same detail populated. An additional piece of information that likely doesn't affect the problem is that the combobox is set-up as three columns so that I can populate two additional fields when the condition detail has been updated. I used the code below to populate that, which works perfectly when I can get the condition detail to appear in the combobox:
Private Sub Condition_Details_Change()
Me.Responsible_Position.Value = Me.Condition_Details.Column(2)
Me.Severity_Description.Value = Me.Condition_Details.Column(3)
End Sub
Thanks in advance for your help!
I figured it out. The relationship I created within the combo box query was unnecessary. The query was searching for values in the table that stored the actual responses/conditions instead of the table that stored the available response options. Because of this, once I had answered the question it knew what to look for, but in the wrong place. Setting up the combo box the usual way with the look-up control value in the form referenced as follows was sufficient to get the combo box to work properly.
Field: Exception_Text
Table: tblPreCloseExceptionDescEnc
Criteria: [Forms]![frmEncompassExceptions].[Form]![Exception Text]

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)