Forms :: Setting Text Box Value According To Chosen Combo Box Value

Feb 7, 2015

I have a form that adds a record to a table in the database.I want that when i choose a value from a combobox in the form, it will change the value of another textbox according to what value was choosed.So essentially what i did is simply go to the combobox AfterUpdate and there i used this code:

If Me.Combobox.Text = "Solid" Then
Me.TextBox1.Text = "grams"
ElseIf Me.Combobox.Text = "Liquid" Then
Me.TextBox1.Text = "ml"
End If

But i encounter 2 problems:

1. When i set a default value to the textbox (which i want to), the changing of the value in the combobox doesn't do anything whatsoever.
2. When i remove any default value from the textbox, the changing of the value in the combobox does change the textbox to the corresponding value but then gives run-time error 2185: "You can't reference a property or method for a control unless the control has the focus".

View Replies


ADVERTISEMENT

Populating The Text Box’s That Relate To The Chosen Combo Box’s With The Sum Of A Cal

Sep 29, 2005

Hi, I'm in the process of building a program in access 2003 for estimating roofs, I've ran into a little problem, as described below. any suggestions would be very useful

Populating the text box’s that relate to the chosen combo box’s with the sum of a calculation.

In other words if X combo box is chosen (There are many combo boxes to choose from) populate xx text box with the sum of a calculation.

Refer to the print screen example of my program: http://www.roofmart.net/Rest.asp

Notice under the label felts the 15lb 36” felt combo box is chosen and it displays the value of 11 and next to the combo box is a text box that displays the value of 25 The calculation will be (11*25) = 275 this value of 275 must be added to the text box values that are being shown in the forms header under 30yr where it reads $4,606.80 and 40 yr $6002.80 only, this is because the 30yr comp and the 40 yr comp combo boxes are the only chosen roof types under the label roof types above the felt label.
Hopefully this makes sense.
Thanks -- Any help with be greatly appreciated.

View 3 Replies View Related

How Do I Display Certain Records Depending On The Option Chosen In A Combo Box

Aug 2, 2005

Hi I'm a real newbie at this but basically I have a form displaying three lots of contacts Expediting, Quotation & Miscellaneous contacts.After choosing the company name from a list box it displays the Expediting, Quotation & Miscellaneous contacts info - but doing it this way there isnt much space on the screen to show all the Contact names,Telephone fax & email addresses clearly& at a decent size.Apart from the company list box I want to have a list box/combo box with:

Expediting
Quotation
Miscellaneous

and then after choosing Expediting, Quotation or Miscellaneous from the list/combobox i want it to take the relevant data from the Expediting, Quotation, or Miscellaneous contacts sections and only display the information relating to those sections only, therefore allowing me to have bigger text and not so cramped display so everyone can read it ok and get more info on the screen for each contact group.

If anyone could help it would be much appreciated!!!! Thankyou in advance for any help. Be gentle with me I am a newbie,lol.

Thanks again

View 2 Replies View Related

Forms :: Setting Up A Combo Box To Filter Another Combo Box

Jan 27, 2015

I'm having a little difficulty setting up a combo box to filter another combo box. I've actually got one working but the second one is giving me all sorts of errors. On the attached database, there's a form called frmAddNewRecord. At the top of the form there's a combo box which allows you to select a name and another combo box beside it which acts as a filter so only names from a certain section are shown (working fine).

The subform which is attached to this form and contains the training details, has another combo box which allows you to select a job...I've tried to add a combo box beside this to filter it but I can't get it to work.

View 5 Replies View Related

Forms :: Setting Combo Box Field

Nov 18, 2014

How do I go about getting data from a:

Text field in Form 1

Clicking a button to run VBA code, and Automatically inserting it into a refreshed combo box in Form 2

I've also attached a pic.

*Also, I'm using Access 2007...

View 5 Replies View Related

Forms :: Setting Maximum Value In Text Box

Nov 20, 2013

I have n text box on main form which contain sum of different fields.. I want to set maximum value as 1000 or sum of different fields.

View 1 Replies View Related

Forms :: Setting Control Source To Combo Box

Jun 12, 2014

I have a combo box control in my form named PayDateID, but I told that control to DISPLAY the associated field PayDate.

I now am trying to make a separate control in the same form whose control source is the DISPLAYED PayDate, but it only wants to reference the underlying PayDateID.

How can I make the control source be the displayed value in that combo box?

View 1 Replies View Related

Forms :: Setting Control Source Of Text Box

Jul 7, 2014

I have an unbound form which has 2 unbound combo boxes on it, both based on the same table, but I have used a query for each one to created the sort order, one alphabetically by item name (cmbA) and the other numerically by the item number (cmbN) . I also have a text field (ID) upon which is based a report when the user clicks a button. Currently the text box (ID) has a control source of column 1 of cmbA and I have the report working perfectly if one selects from the name combo box (cmbA) What I want to do is allow the user to select from cmbN and have the control source of the ID text box equal the number the selected so the report button will work then also.

I have tried to set the control source after update of cmbN but all that does is blank out the ID text box. I have not done this before so I am sure I have done it incorrectly. I tried again this morning using me.ID.ControlSource = Me.cmbN and stepping through the code shows that the cmbN ControlSource is equal to ID but I can't make the code that follows use the results.

View 8 Replies View Related

Forms :: Setting A Field On Form To Only Allow Text Input

Jan 9, 2014

Is there a way to setup the format on fields to only allow text inputs, no numbers wanted. I know I can do this at the table level but is some cases numbers are ok. So I want to code it so I can control when numbers are ok and when there not.

View 1 Replies View Related

Forms :: Multiple Between / And Criteria But Only One To Be Chosen

Oct 20, 2014

I have a form where users can enter the beginning and ending dates into text boxes. They could also do it for the number of the week (1 to 52) or a single text box for the quarter.

I set up VBA code where, if you click on a button, it will clear out the data from the other two options before a query is run based on the parameters in those text boxes. Here's a sample piece of code.

Code:
Private Sub btn_UseDates_Click()
Dim lngGreen As Long, lngWhite As Long

lngGreen = RGB(0, 255, 0)
lngWhite = RGB(255, 255, 255)
Me!txtDateFrom.BackColor = lngGreen
Me!txtDateTo.BackColor = lngGreen
Me!txtWeekFrom.BackColor = lngWhite
Me!txtWeekTo.BackColor = lngWhite
Me!txtQuarter.BackColor = lngWhite
Me!txtWeekFrom = ""
Me!txtWeekTo = ""
Me!txtQuarter = ""
End Sub

I've tried setting those txt boxes to Null and I've tried both "" and " ", but to no avail. The query will work if the three types of ranges (date, week, or quarter) are on OR lines, but not on the same line.

View 5 Replies View Related

Forms :: Fill Text Box Based On Combo Box (not Using Columns In Combo Box)

May 21, 2014

I'm looking for a way to have a text box auto fill based on the selection of a combo box on the same form. I cannot use the method i find all over the internet of using multiple columns in the combo box and basing the text box on that because the combo box already has multiple columns being used to determine its own possibilities and other combo box possibilities.

I would really just like the text box to work like this, but im still kinda inexperienced in VBA...

If combo box is "F004-001", then text box is "237"
If combo box is "F004-003", then text box is "280"

I know how to add in an "after update" thing, but i do not know how to do If/then statements.

View 1 Replies View Related

Forms :: DLookup - Unbound Field To Auto Determine Pricing Based On 3 Criteria Chosen

May 28, 2014

I have a table that consist of pricing for different types of products:

Table name: Costs

ID TYPE EastNew EastRenew WestNew WestRenew
1 500 4100 1000 4400 900
2 501 4100 1000 4400 900
3 600 3400 900 4600 1200
4 700 3700 1300 4900 3300

I have a form that consist of many fields that the user needs to manually input data. 3 fields on that form are the criteria i need to determine which pricing to use back on the table. The first field, which name is LTYPE, is a combobox that the user needs to choose as its type (i.e 500,501,600,700). The second field, which name is EastCoast, is a checkbox (Yes/No) that tells me if it's East Coast (East = yes and West = No). The third field, which name is NewRenewal, is a combobox that the user chooses NEW or Renewal).

Example 1, if the user chooses type 501, checkbox is YES for East, Product is NEW. Then the pricing is $4,100

Example 2, if the user chooses type 700, checkbox is unchecked for NO (which is West), Product is Renewal. Then pricing is $3,300

I would like the unbound field to auto determine the pricing based on the 3 criterias chosen. I read around the forums that Dlookup would be the function for this, however, i tried many times but it did not work.

View 6 Replies View Related

Forms :: One Combo Box Based On Another Combo Box And Text Box Uses

Jun 4, 2013

I have been creating a form, based on only one table. Here I am displaying data as text boxes and subfrom from the same table. At the beginning, I was interested in controlling the display of the data according to the combo box (in this case is the PO number). Now, I would like to add another combox box which is the year (I have a column with the date, and also I have a column that shows only the years digits in my table) Also, I have a subform that display the data from the same table specifics records that I want. It means that I want to pick the year first, and then in the combox box of po number shows only option of that year, and hence the text boxes and subforms change accordingly to the two combox boxes.

View 2 Replies View Related

Forms :: Setting Text Box Format To Short Date And Optional Short Time

Jun 21, 2013

I want to be able to set text boxes so that if one enters a date and a time it displays in the format "dd/mm/yyyy hh:mm", but if one just enters a date is displays in the format "dd/mm/yyyy". Is this possible?

Stipulating "dd/mm/yyyy hh:mm" means that when you just enter a date it adds "0" values for the time e.g. entering "21/6/13" gives "21/06/2013 00:00".

General Date allows for an optional time, but it means that when you do enter a time it gives you seconds as well "dd/mm/yyyy hh:mm:ss" - and I don't want that.

View 7 Replies View Related

Forms :: Putting Text Into Combo Box?

Apr 5, 2015

I have a combo box with an associated label.

I want to eliminate the label and have the label text be part of the row source of the combo box.

The combo box is based on a select statement.

View 14 Replies View Related

Forms :: Combo Box To Populate Text Box

Dec 10, 2014

I am newish to background coding in access 2010. I have a call log with a form which is where the information on the caller/area is entered. There's a combo box that needs to populate a textbox with 3 different things, depending on whats selected. I'm using If,Then, Else.

The first selection needs to just have the textbox say something. I have that figured out with:

If Me.CboSource = "..." Then
Me.Title = "..." (cboSource = combo, of course, and Title is the textbox.)

Next is where I'm fuzzy....The second selection needs to have the textbox populate with a dropdown list of choices from another table. No matter what I do, nothing is working. My latest attempt is:

ElseIf Me.CboSource = "External" Then
Me.Title = [tablename].[name]

View 10 Replies View Related

Forms :: Linking A Text Box To A Combo Box?

Apr 6, 2014

I have a text box on a subform that I want to use to control a combo box on the main form - I know it's not how things should be done but I've no choice - these are my instructions. I'm using Access 2000.

The text box displays a short data in dd/mm/yyyy format and when data is entered into it, it populates a field in Table 1. The combo box displays all the months of the year which it obtains from another table which only has months in it. The combo box properties have Limit to List set to Yes. Once a Month is selected, it populates the month onto another Table, Table 2. The months have all been assigned with a numeric identifier (i.e. 1 for January and so on) but only the name of the month appears in the combo box.

What I have to do is have the combo box update the month it displays based on the short date in the text box. I've tried the After Update event on the text box to no avail. The code I tried there that didn't work was:

Quote:

Private Sub txtDate1_After Update
Me!txtDate1 = Me!cmbMonth
End Sub

I've tried similar code in the On Enter even for the combo box and this too failed. I've also tried switching off the Limit to List property of the combo box and this didn't work either.

I've also tried to set the combo box so that it links to the exact same fields as the text box and while this did work, all it did was have the date be displayed in the combo box in short date format and not as the name of the month.

I'm struggling to understand if this update is even possible. Can a combo box that has a Row Source limited to options in one table which it then updates onto a field in another table be controlled by just part of the date from a text box?

View 13 Replies View Related

Forms :: Align Combo Box Drop Down Text?

Mar 20, 2013

it possible to align the row source values of a combo box? i want to align it to the right instead of the left

View 2 Replies View Related

Forms :: Auto Populated Text Box From Combo Box Value

May 8, 2013

I have a form for 2800 different records. I want to auto populate 4 text boxes based on the value of 1 combo box but when I change the data on 1 form, all the forms show the same data. I want to be able to able to change the data on each form and save separately.I have Table with Tech Initials(PK), Full Name(689), CellNum(691), TestGaugeSN(630) and Cal Exp Date(632). Want to use Tech Initials to populate the rest.

Here's what I'm using:

Private Sub Combo687_AfterUpdate()
Me.Text689 = Me.Combo687.Column(1)
Me.Text691 = Me.Combo687.Column(2)
Me.Text630 = Me.Combo687.Column(3)
Me.Text635 = Me.Combo687.Column(4)
End Sub

View 1 Replies View Related

Forms :: Combo Box / Text Box Auto-Populate

Oct 14, 2013

I have 5 combo boxes that all cascade into the next, and then when the last combo box is updated from the drop down list, it auto-populates a text box. My issue is that I have a second text box that needs to be auto-populated from the same data table based on what has been entered into the 5 combo boxes and the first text box. I've tried creating parameters and setting a lookuprecord macro in my main table and then using a returnvars RunDataMacro on the actual form, but it says, "Invalid list or query reference 'BillingDataQuery'." I'm not sure if it's because I'm not setting that RunDataMacro on the wrong combo box, or if I've written it incorrectly...

I did this same technique (based on directions in a post from this forum) on another combo box that populates five text boxes and it works just fine, but I don't know how to get this to work based on what's populated in 5 combo boxes to auto-populate the last text box.

View 3 Replies View Related

Forms :: Two Combo Boxes Populate A Text Box

Jun 26, 2014

I need to populate a text box with data from a single cell contained in a table.Im hoping to use two combo boxes that when selected will select the cell. The combo boxes select data sources from the same table. One combo the row the second the column. One combo is already in use and populates several fields in the form. In the same form I'd like to place the second combo and beneath it have a text box that will populate with that cell detail.

View 3 Replies View Related

Forms :: Text Box Based On Combo Box Selection

Dec 31, 2014

I am trying to auto populate the text boxes in the form based on drop down from the combo box. As you can see in the form Frm_Input, this works fine for FL, but for some reason it will not populate for Skill, Role, FLM and Location. The table it is linking to is Tbl_Names. Why as I have changed the column source?

View 8 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 :: Filter Text Boxes By Two Combo Box Values?

Aug 6, 2013

I have a form with two combo boxes. The first box lists switch names from a query, and the second lists switchports from another query. The switchport query lists all the switchports for whatever switch is selected in the Switch Name combo box, and all the settings for that port (one column per setting). I want each text box to display the corresponding data from the switchport query for the switch selected in the first combo box and the switchport selected in the second combo box.

View 3 Replies View Related

Forms :: Populate Combo Box After Updating Text Field?

Mar 19, 2013

I am trying to create a login form with the following three basic fields:

txtUsername
cboUsertype
txtPassword

I would like to be able to populate cboUsertype with User types associated to the user I type into txtUsername. I have found many useful tutorial on the web on login procedures. How ever I hardly found anything on how to populate a combobox after updating a texfield. It bis more than a week that I am trying to find a solution but until now I have just been . I would be grateful if you could provide me with either a link on the web or a vb code to make it work.

View 3 Replies View Related

Forms :: Color Text Field Based On Value Of Combo Box

Feb 28, 2015

I have a table named ColorValues with the following three fields:

- ID
- MunsellCode
- RGBValue

30 fields from another table called Color_Analysis are linked to the above with one to many relationships (I've already thought of other ways to normalize data, but this is the most efficient, so no need to go into this topic).

Now, I've constructed a form for Color_Analysis and all 30 fields recording color are included as combo boxes bounded on the ID in ColorValues and displaying the MunsellCode for the user. I've also created unbounded text fields next to the combo boxes and want to use them to display the color that the user selected in the ComboBox. The question is how do I do this?

Essentially I need a piece of code that picks up the value of the combo box (this is essentially the ID in ColorValues), looks up that value in the ID column of the ColorValues table and uses the corresponding RGBValue of the same table as the .BackColor for the unbounded text field.

View 8 Replies View Related







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