Forms :: Populating Textbox From Combo Box

Apr 28, 2013

I am trying to populate a textbox based on selection from combo box. Both fields are in two different subforms within the same form.

I do see the selection from the combo box fills via debug. I don't see a value in the textbox.

This is the code I am using:

Private Sub cboRequestedItems_Change()
Me.PricePerUnit.Value = Me.cboRequestedItems.Column(1)
End Sub

View Replies


ADVERTISEMENT

Problems Populating A Textbox From A Combo Box

Jan 5, 2007

I'm really hoping someone can help me, as I'm about ready to tear my hair out at the moment!!!

After a few problems, I've managed to set up a subform with three cascading combo boxes (i.e. "Family", "Order", "Common species name"). However I want a fourth field (a textbox: "Latin species name") to update automatically when the value of common species name is selected, so that the appropriate Latin name appears in the textbox at the same time.

Subsequently, in the afterupdate event of the "Common species name" combo box, I put the code:

Me.Latin_Name = Me.Common_Name.Column(2)

(Where Common_Name.Column(2) is obviously the field containing the value for Latin species name.)

Which seemed to work fine.... for the first record at least!

The problem comes when I try to add a new record to the subform - and instead of resetting, the "Latin species name" value entered in the first record also carries over to all subsequent records.... and changing the value in any later record simply also changes it in the first (and all other) records.

Can anyone work out what I'm doing wrong here? Any help will be much appreciated!

View 6 Replies View Related

Forms :: Populating Combo Box Based On Text Box

Nov 19, 2013

I have a text box that displays a name of a law from one table, based on that law name I want to populate a combo box with different options on how to comply with that law that come from a different table. The compliance options I need to pull in are different for each law. Finally I would like to have the selected option saved in the table the laws are coming from.

I have tried using a rowsource query [Form]![form1]![Law] for the combo box of law options but keep getting errors.

View 3 Replies View Related

Forms :: Combo Box Populating Underlying Table Incorrectly?

Mar 9, 2015

I am using a form with a combo box (FieldExpenses) that lists from a query row source (SELECT statement). Whether entering a new record or editing an existing record on the form, the selection in the combo box populates the field in the underlying table (TableTransactions) with the row ID (ex: 105), not the desired field (ie: Telephone).

I tried using a split form and the table in the form shows the field correctly. If I open the underlying table separately, the field displays the row ID. It's not working as I wish.

View 2 Replies View Related

Forms :: Populating Only Key Field Value Form Combo Box Selection?

Aug 10, 2015

In the Contacts Table there are two fields, the unique Contact ID key field numeric and the Contact Name. Like this:

Contact_ID; Name
1; Tom
2; Dick
3; Harry

In a form named "Selection" there is a Combo box that references the Contact table, and lists just the three names in the drop down (showing the Contact_ID is optional - I'm fine either way):

Tom
Dick
Harry

When the selection is made it will populate the field Contact_Ref the table called SelectedName.

Question: When the user selects the name I'd like the data populated in the SelectedName table to be the Contact_ID Value, and not the Name, so if Harry is selected the Value "3" would be saved.

View 3 Replies View Related

Forms :: Populating Text Box Upon Selecting Multiple Items In Combo Box?

Nov 28, 2014

Now I have a combo box "cbo_items" and a text box "txt_selectedItems", I want to populate text field with items selected from the combo box, every time i select an item it appears in text box and to be separated with comma, so text box appears like this ( item1, item2, item3), and after finishing the whole thing the result appears in lable "lbl_result" as "total items selected: 3 items".

View 1 Replies View Related

Forms :: Subform - Combo Box List Not Populating According To Main Control

Apr 17, 2014

I am using MS Access 2010, I have three tables,

Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)

I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".

In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:

Code:

SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));

Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.

how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control

View 4 Replies View Related

Forms :: Populating Text Box Based On Combo Box - Separate Form

Aug 14, 2015

The main issue I'm having is trying to populate a text box based on a combo box selection. I've found threads on that - the twist that is throwing me for a loop is that I'm dealing with two different forms.

I have a main/welcome form with two combo boxes on it. Based on the user's selections in these two combo boxes, two different forms are opened for data entry. For instance, box 1 has A, B, C and box 2 has x, y, z. If a user chooses B and z, then form B and form z are opened. What I want is for a text box to be populated on one of the opened forms, not the same (main/welcome) form. In other words, when B and z are chosen, I would like there to be a textbox autofilled with "z" on form z.

View 2 Replies View Related

Forms :: Select Record In Combo Box And Populate Textbox

Sep 19, 2014

I am looking to have a combobox on a unbound form to select a product code (this i can do). However I want a textbox to auto populate with the description as well - both in the same table tblproducts - product_id, pcode, pdesc....

View 4 Replies View Related

Forms :: Value To Put In Textbox For Field In Same Table As Combo Box Selection

Jul 8, 2014

I have a form frmCrisisSupportWorkers with a tab control on the form. On the first tab, Personal Info there is a combo box called cboLocation. It is next to the Town/City.

I have a text box that updates the postcode after the selection is made below it but that is as the post codes are stored in the combo box and I just put the column for the postcode in the control source of the text box.

I can't do that for state as I have it stored in another table and use a numeric identifier to show which state is selected.

I want to have a text box below that auto updates the state once a town is selected but I can't seem to get it working.

View 14 Replies View Related

Forms :: Todays Date On Textbox Based On Combo Box

Sep 2, 2014

I have a "Status" combobox, I'd like the "Date Case Closed" field to auto fill today's date when "Status" combobox = Closed. The way I know how to do this is by using an IIf with Date() function, but, if I do that, the date is gonna keep changing everyday. Do I have options to do this?

View 3 Replies View Related

Forms :: Scan Barcode To Choose Item From Combo Box - Populate Textbox With Result

Jun 14, 2013

I'm working on a project that uses a barcode scanner. The user will scan a barcode which will choose an item from a combo box. The result of what it enters will populate a text box. I have that part working fine.

The next step is to get it to open a form based on the value in the textbox. The textbox will have about 7 different possible values and each one should open a different form.

The way this is supposed to work:

User approaches a machine and scans the barcode. He is presented with a form giving him options based on the type of equipment the machine is. A compressor for example would present him with a set of options for compressors (gauge readings, maintanence, etc).

I have an unbound form with two controls:

cboAssetNumber
txtType

How to code this and which events to code it in. Users will be going from machine to machine and using the form over and over again so I need to somehow manage the clearing of the form to begin again with another barcode scan.

I saw another thread about a barcode scanner and one response was to program the scanner to send the barcode and then send an "Enter" press to move focus to the next control. I've looked through the documentation and haven't been able to find if that is possible. Right now it sends the number and that's it. It's a "Motion" Tablet.

View 14 Replies View Related

Populating Combo Box Based On Data In Another Combo Box

Jan 23, 2006

Hi all!

It's been a while since I've used Access, and I seem to have forgotten this.

I have a form which allows entry of Borrower's details. I have 2 combo boxes on the form.

They are:

cboBorrName
cboLoanSN

Once the user selects the name from the cboBorrName, I want the cboLoanSN to display all loans associated with the Borrower so that they can select the correct loan and add repayment details accordingly.

I have added the following SQL statement as the record source of cboLoanSN

Code:SELECT * from tblBorrower WHERE tblBorrower.fldLoanSN=[Forms]![frmBorrower]![cboBorrName]

I have also added the following code in the After Update event of cboBorrName

Code:Me.cboLoanSN.Requery

However, it doesn't work.

Can someone please help me out?

Thanks a bunch!

View 6 Replies View Related

Populating A Combo Box

Nov 23, 2005

On my form i have a list which takes information from a table. I have set column headers to "on". What i want to do is populate my combo box with the column heads in my list box. Anyone have any ideas?

Cheers,
Matt

View 1 Replies View Related

Forms :: Update Unbound Textbox In Main Form From Subform Textbox Afterupdate

Apr 17, 2015

How to update unbound textbox on main form from unbound textbox in subform afterupdate.

that is when amount paid is updated it automatically updates total paid, balance etc.

View 2 Replies View Related

Populating A Combo Box In A Sub-form

May 8, 2007

Good day,

I have a main form with project data and a sub form that has related financial information. Once the user selects a particular project from the ProjectType drop down box, a field called Project Codes in the subform should be populated with only project codes for that particular Project Type.

Can someone assist?

Thanks

View 5 Replies View Related

Populating Combo Box With Last 5 Entries

Apr 8, 2005

Nubie question ( first real database)

I'm trying to populate a combo box with the last few entries of a record. I've been looking on SQL Queries and can see a way of using SELECT TOP on the recordset but querying/sorting the whole record every time seems a very clumsey way of doing it (especialy if the recordset gets large).
So is there a more elegant way of getting lastrecord,lastrecord-1,lastrecord-2, etc into my combobox ?.

Note as a suplemental question is there a way of a subform showing records from last to first instead of what seems to be normaly first to last?

Thanks for any help.

View 4 Replies View Related

Values In Combo Box Not Populating On Some Computers

Feb 4, 2008

Hi,

Hopefully this is a really simple requiring a simple answer.... hopefully

On one of my forms I have a combo box thats values are generated by a parameter query. On my computer and a couple of others i tested it (on the same network) this combo box populates fine, but i put it on a couple of other computers today and it doesn't show any values. I checked and the query itself runs fine, plus a combo box that runs off a table populates fine.

not too sure if its relative but the database is split with the tables sitting on the network share and the database sitting on the main computer. or perhaps this could have something to do with blocking unsafe expressions.. i am not sure

any help on this would be greatly greatly appreciated

View 8 Replies View Related

Populating Combo Box With Certain Select Queries

Jan 7, 2008

I have a form that has a combo box that contains every query in my database. This worked fine until i started having to create cascading queries to return the data I want. How can i populate my combo box with only certain queries in my database.

This is the code I was using to put all queries into my combobox.

FROM MSysObjects
WHERE MSysObjects.Name NOT LIKE "~*" AND
MSysObjects.Type = 5
ORDER BY MSysObjects.Name;

Upon clicking a button or clickin the query in the list, I want the query to run......So the main question is how to I include certain queries in my combo box but not all of them? I do not know SQL or any programming, so as specific as possible will help immensely. Thank you everybody.

View 1 Replies View Related

Combo Box Populating Text Fields

Jul 19, 2006

Hi All

Been having trouble setting up a combo box in a form that displays data from the same line in the table into a text box.

I am trying this with a memo field without any luck. I am using a 2 column query for the combo box, the first column contains the name and the second contains the requirements (memo).

I have put in the after update code:

Private Sub CustName_AfterUpdate()

Me!CustReq = Me![CustName].Column(2)

End Sub

Can anyone please shed light on what I'm doing wrong?

Thanks

View 3 Replies View Related

Combo Selection Populating A Text Box

Nov 13, 2006

Probably an easy one here...I have a series of cascading combo boxes where once the last once it chosen, I'd like some sales info to populate in a group of text boxes. What command would I use for this?

Also, I have a checkbox that I'd like to use to either enable or disable a textbox as well. Any ideas?

Thanks!

View 12 Replies View Related

Urgent Help Please With Combo Box And Populating Tables

Oct 31, 2004

I am trying to create a database which will act as a timesheet and management system.

I have several tables set up. some are:
01-Staff details containing Staff ID, Names, etc
11-Timesheets containing Timesheet ID, Staff ID, Timesheet Period ID
17-Timesheet Periods containing Timesheet Period IDs, Start Date and End Date.
13-Hours containing Hours ID, Timehseet ID, Project ID, Hours
etc.

I want to set up a Combo that lists Names from Table 01-Staff Details, and when the user selects their name, enters the Staff ID on a new row in the tabll 11-Timehseets.

I am able to create the Combo to list the names from 01-Staff Details, but am not able to get the selected name to jump into 11-Timesheets. The field is not available in the Control Source.

Could you please assist? I am not an Access expert, nor have I done any programming, so a step-by-step solution would be greatly appreciated!!

Many thanks in advance

Sunil

p.s. I would then like to ensure that users can't edit data in certain tables (eg. they shouldn't be able to create a new Staff ID/name, etc)

My next task will be to create a sub-form (which I am able to do) where the user can select a project from a combo-box and enter the hours worked on it. I would like the project and hours to be entered on a new row under the table 13-Hours

I look forward to your reply!

Many thanks

View 4 Replies View Related

Populating A Text Box Using Combo Box Filter

Nov 18, 2004

Hello,
This is my first time posting here and I hope someone can help me. I am not experienced with coding in access and only recently started using forms.

I am trying to create a text box that automaticly fills in once a selection is made in a combo box.

There are only 2 tables and 1 form I am working with. Table 1 has columns "code" and "bu". The second table has several columns, all blank, that the form fills in.

The combo box is working correctly, it displays all the "code"s. Once the code is selected I would like a text box to display the "bu" column.

Any suggestions are much appreciated.

View 4 Replies View Related

Populating Form - Combo Box Or Alternative?

Aug 28, 2006

If any one can make a suggestion it would be great. I have a list of names with phone numbers, addresses and emails. I thought I could use a combo box to select the name and and have the other date associated with it come up in the appropriate boxes set. I can't get it to work. Does any one have any suggestions on how to make it work or another method that can be used. The out come I want is to allow someone to pic name from a list which will then set the phone number, address and email correct. Ideas would be great.

Thanks Tracey

View 1 Replies View Related

Modules & VBA :: Populating A Combo Box From A Query

Oct 18, 2014

I am trying to populate a combo box (cboVenderID) with one of the two queries below.

But "Set rs = db.OpenRecordset(strSQL)" causes a Run-time Error '3016': To few parameters. Expected 1.

I am quite new to VBA and SQL.

Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim intVenNum As Integer
intVenNum = Me.cboVenderTypeID

[code]....

View 4 Replies View Related

Populating A Text Field From A Combo Box Selection.

Apr 28, 2005

I have a combo where the list is populated with a bit of VB code to create a two field list. When the user selects the item they want from the list it displays the item in the combo box and should populate a text box in the same row with the value from the second column.

This combo is part of an orders subform and the user is selecting a product from the list which displays the product_name and the product_id.

The problem is that the product_id is not filled in and access returns the following error:
Run-time error ‘3101’:
The Microsoft Jet database cannot find a record in the table ‘product_table’ with key matching field(s) product_id.

This is the VB code that populates the list :
[code]
Private Sub comboCatagory_ID_AfterUpdate()
Dim sProd_description As String
sProd_description = "SELECT products_table.product_id, products_table.prod_description " & _
"FROM products_table " & _
"WHERE products_table.prod_catagoryID = " & "'" & Me.comboCatagory_ID.Column(0)
Me.comboProd_description.RowSource = sProd_description
Me.comboProd_description.Requery
End Sub
[end code]

What am I doing wrong?

Thx
Kev.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved