How to populate the value of a Text Box based on the value in a Combo Box in MS Access 2007? - forms

I have a combo box which is of a lookup type, i.e., I've selected the source to be a column from a table and am storing the selected value in another table. The table which I am looking up has another column and I need the value in this column to be displayed in a text box and each time I change the value in the combo box, I need the corresponding value to be displayed in the text box. How can I do this? What I have done so far is to write a Select query that selects the appropriate column based on the combo box's value. Is there a more decent way of doing this? Please help me!

Make the source of the combo box to your 2 fields e.g. SELECT id, name FROM Customers
Make sure you set the Column Count property of the combo to 2, accordingly.
Then make you unbound text box source equal to =MyCombo.Column(1) (from memory, this Column is zero based).
That's it, zero code required.

It's nicer to use an event of the combo box e.g. onChange, so when a selection is made the event sets the value of the text box.
me!txtTextBox1 = me!cboComboBox1.column(1)
That way it will work everytime.
You could also use a button with onClick etc. but the choice is yours (and as mentioned in the previous post, alter the column number based on its row source with 0 being the first.

After reading the question and answers I tried the following, and it seems to work well (so far):
In order to display more than one column of a combobox selection, I have resorted to the following:
Place a textbox over the combobox,
Size it by sampling other fields, so that it covers the text frame of the combobox.
I have purposely have left a small space to the right of the NEW textbox to indicate that it
Is NOT part of the combobox.
In the Control Source for the textbox enter the expression below:
=[DefaultAcct].[Column](1) & " " & [DefaultAcct].[Column](2)
Then, in the ‘onchange’ event of the combobox, set focus to the textbox.
Private Sub DefaultAcct_Change()
txtConcatenate1.SetFocus
End Sub

Related

Combo Box Dropdown List from Table

First time creating forms to insert into a database.
I'm trying to create a drop down combo box that lists the entries in the second column...
This is in a seperate table. The issue I'm running into is how do I show what's in the Description column, but when I insert into the form, it's corresponding PMRT_Need value is put in the table.
The database is as such that it HAS to be the PMRT_NEED value unfortunately.
Thanks for your time!
After setting the Row Source to your appropriate table/query:
Set the Bound Column to column 1 (i.e. the PMRT_NEED field)
Set the Column Count to 2
Set the Column Widths to something like 0cm;5cm (adjusting the second width to suit your data) such that the first column isn't displayed to the user.
This ensures that your combo box returns the value of the PMRT_NEED field for the selected item, but only the Description is displayed to the user.

QlikSense choosing amount of listed item

!https://i.imgur.com/tfr0N27.png "Qlik Layout"
So I have this screen and I would like to make it so the user can choose the amount of each selected item. I would also like for the KPI to show 0 if nothing is selected. Any ideas?
I'll try Measure like this:
IF(GetSelectedCount(ProductName)>0,SUM(ListPrice), 0)
The amount of item can be set using input boxes. Problem is input box is per variable so you would have to define input boxes for each product and then make long list... even for that you need input box extension from Qlik Branch. In Qlikview there is functionality to add inputSum function in table which could be perfect in your case but is not implemented in QLikSense. If it is really necessary you can create own extension in Qliksense with html table of all products and form which is updating variables.

building a form with dynamic fields in progress 4gl

I am trying to display a list of open indents with check boxes before them each line. Based on the selection a report will be generated next with further details.
Table: xxind_mstr (xxind_nbr, xxind_shipto, xxind_askedby, xxind_date).
Is there any way that I can bring the records from xxind_mstr and place them in the FORM with check boxes ?
Note: This only works if dynamic. Never hardcode this approach.
Name each check box with the value of ROWID(xxind_mstr).
This way on the post you can read back through the each xxind_mstr getting the value of the the rowid.
Rod
I'd like some more info, just to know if I'm not talking rubbish here. You want to display the records in xxind_mstr as checkboxes, then upon selection of the report setup, fire the report respecting the checkboxes flagged? If so, then I'd use a browse pre-built with a temp-table containing the xxind_mstr records, and a "flagged" field, this being a logical view-as checkbox, and when they run the report, do a
FOR EACH ttxxind_mstr WHERE flagged = true, and you should have what you want.

SSRS cannot linked text box with field

I group my table by 3 attributes, and set page break on every group, and now i want to display that three attribute outside the table. I want to place them on the top of the report, and when i type the expression and i go in run view it's display only the first value, when i go to the next page nothing change
I tried to drag field from table, from data set, and nothing working.
In expression i type
=Fields!My_Field.Value.
Also if some of that three attributes i placed in table it normally displays values, but when i try to move it somewhere it stops displaying.
The issue is that a table is associated with a dataset but a text box is not.
You can reference a field from a text box using the Dataset field ( =Sum(Fields!AMOUNT.Value, "Dataset1") ) but you need to use an aggregate function like First, Last, or SUM.
It sounds like you don't want to use an aggregate since you are grouping by these fields, though.
display the three attribute outside the table
If your trying to display the current grouping in the table at the top of each page, add a new Row in your matrix above your header row and add your group fields there.

MS Access 2003 - Listbox formatting control

Just some general formatting questions about return records to a list box on a form:
I have a list box that returns sets of records based on SQL statement in VB. I need the SQl statement to return the ID (auto number) of each record, because if the user selects from this list box, I need the ID as a pass parameter to the next form. But I do not need the ID to show up in the actual list....anyway i can hide this, or just not display it?
I used rowsource like this:
me.searchlist.rowsource = "SELECT TblMain.MainID, TblMain.First, TblMain.MiddleTblMain.Last FROM TblMain ORDER BY TblMain.Last, TblMain.First DESC;"
Also the listbox has no headers, which i want, and has three columns for above example...but each column is way too big, can i control the width size of each column area inside the listbox? I tried the properties window, but that only seems to effect the first column and not all of them.
For the Header, the Listbox has a
property called Column Heads
(default no). Set this to Yes.
For the column widths, the Listbox
has a property for Column Count and
Column Widths. In your case you can set Column Count to 3 and Column
Widths to something like 0;2;3