Modules & VBA :: Display Text Depending On Combo Box In Different Form

Aug 6, 2013

I want to display the text from one combo in a text box in another form based on what's selected in a second combo box. The text box is in a different form from the combo boxes.

Sub D_ComponentTypeCmb_Change()

If Me.D_ComponentNameCmb.Value = "Customise" Then
Forms!CustomComponentF!C_ComponentTxt.Value = Me.D_ComponentTypeCmb
Else
Forms!CustomComponentF!C_ComponentTxt.Value = ""
End If
End Sub

View Replies


ADVERTISEMENT

Display Picture Depending On Combo Box.

Dec 14, 2006

Hi all! i am wanting to display a signature (jpeg image) when a combo box is displaying "Yes" and the picture to be hidden when the combo box is either empty or set as "No". i have before managed to change colours of other fields depending on combo boxes - but my coding isnt that great, so i dunno what code is req'd!all help much appriciated!thanksDave

View 4 Replies View Related

Need A Combo Box To Display Different Lists Depending On A Control

Dec 1, 2005

Hi, I'm not sure how to write something and would like assistance. The form is taken from a table and then there are two diffenterent forms displayed as datasheets within, on tab controls. I have a combo box taken from a query on each form and would like the combo box to display a certain list if the control on the form (the bit taken from the table) has a P in it, a different list if the control has an R in it or to display the whole list if the control has a B in it. Trouble is, I'm quite new to this and I'm not sure on how to write any code for if statements or whatever is needed. If you are able to assist I would appreciate it. Thanks

View 1 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

Changing Rowsource In A Combo Box Depending On The Text In Another

Jul 10, 2007

Hi all,
I am trying to have the rowsource change on a "subcategory" combo box depending on what the "category" combo box says.

I added an event procedure to the "Category" combo box which changes the Row Source in the subcategory combo box to something else. I'm not sure that I did this right as if I close the database and reopen it, what I selected in the subcategory combobox is gone and it is blank. Any ideas? Here is my simple, likely incorrect event procedure:

Private Sub Category_Change()

If Category.Text = "Rare Books" Then
SubCat.RowSource = "scRareBooks"

End If

If Category.Text = "Legal Documents" Then
SubCat.RowSource = "scLegalDocuments"

End If


End Sub

Thanks!

View 5 Replies View Related

Modules & VBA :: How To Update Text Box Depending On Value

Mar 30, 2014

right I have auditing system in my database that tracks any changes made to any records. it logs it on a separate table and i show it on a continuous form.

right my problem is that I have loads of check boxes and text boxes on my main form on the form that records the main form I have a field call "new value" this is a text box but if I change a checkbox on the main form it will show -1 or 0 in the new value field on the recording form but I would like it to say yes or no I have tried the following

Code:

Private Sub New_Value_AfterUpdate()
If [New_Value].Value = -1 Then
[New_Value].Value = "yes"
End If
End Sub

this only works if I enter -1 manually but the data is entered automatically after the record is saved on the main form ...

I have also tried on enter before update I get error but now I need it to change on new entry...

View 8 Replies View Related

Forms :: Display Certain Fields On A Form Depending On Criteria In Another Cell

May 6, 2013

I would like to only display certain fields on a form depending on a criteria in another cell. For example if some enters 4 in 'Schemes' it would display 4 data entry boxes scheme1, scheme2, scheme3 etc - is it possible?

View 7 Replies View Related

Modules & VBA :: Filter List Box With Combo Box Depending On Check Box

Jun 10, 2013

I have a form wich includes listbox of employees. When I click on them, it shows his or her data (date of birth,address,etc...). For every employee there are also three diferent checkboxes - if he is regularly employed, temporaly employed or student.So now what I need is to filter listbox of employees - only student or only regular or only temporar or all.I was wondering if I can do that with combobox, but I really dont know how. I am prety new to VBA.

View 13 Replies View Related

Modules & VBA :: Combo Box Will Display Specific List Of Items - Form Asking For Parameter

May 5, 2015

I have the below code behind a form so that a combo box will display a specific list of items based on the data in another combo box on my form.

I have two copies of this same form for two different departments. One of the forms works like a dream. However, when I copy that form, change the name, and update the code as pictured below, the form is asking for a parameter FROM MY ORIGINAL FORM and will not requery the combo box. I can't figure out why...there is no reference to the original form in my VBA as you can see below. I tried deleting the form and re-creating it, I tried deleting the code and re-typing it to no avail.

Private Sub cmboType_AfterUpdate()
Me.cmboAction.RowSource = "SELECT tblStatusList.Status FROM tblStatusList WHERE (((tblStatusList.Department)=[forms]![frmInquiryFraud]![cmboType]));"
End Sub

View 4 Replies View Related

Load Record To Form Depending On Value In Combo Box

Oct 10, 2007

Hey,
I have 2 combo boxes. The first one gives a lis of Prefix letters for railcars. The second uses the value of the 1st and finds railcars that start with the same letters.

finally got the 2nd combo box to list the prefix and number of a railcar based on the 1st combo box and also got it to clear as each run-through starts.

Now that the user can select a number (ex. dfcv1234 as the railcar), I need to find the record with the prefix dfcv and the car number 1234 and load the record to the form for view and editing.

So far, I know it needs to be the after update event and have a select statement that finds the [key], [prefix], [car_number] that matches the value selected on the form but how do I use the key to make the record show on the form?

Thanks,
slh

View 5 Replies View Related

Forms :: Adding Combo Box To A Form Depending On Input Values

Sep 23, 2014

I want to add a combo box to a form, where depending on the values entered in the box another combo box would show more values. In other words, if the first combobox had choices of 1, 2, 3 and 4, if 1 was selected the next combo box would have values a, b, c and d. If 2 was selected, it would have values of a, d, e, f and g.

View 2 Replies View Related

Forms :: Text Box Background Color Depending On Its Value In Continuous Form

Jul 13, 2013

In Access 2007 (or 2010 , 2013), in a continuous form, I want to change the background colour of a text box depending on its value. Obviously, for each record, the color can be different.

View 1 Replies View Related

Combo And Text Box Display Question

Jan 21, 2007

Hi all

Go nice and easy on me. This is my first serious DB and i've picked a cracker to start with.

Basically i am trying to set up a booking system for excursions, booking seats on coaches, trains, printing tickets, vouchers and information.

At the moment I'm trying to populate a text box (txtExcursionCost) in a form with a cost with is drawn from a table (tblExcursions).

tblExcursions holds information about the excursions including the info which populates combo box (cboExcursionTitle) and combo box(cboExcursionDate). The date combo is dependant on what is selected in the Title combo. The text box (txtExcursionCost) needs to be dependant on the Title and Date combos to get the right cost displayed. How could I get this to work?

The reason for the text box is that it only needs to be displayed to show the user the cost of that particular excursion and to create a base for a calculation for Amount Due at the completion of the transaction.

Hope this makes sense.

All help greatly appreciated thanks.

Snab

View 14 Replies View Related

Forms :: Form That Adds Data To A Table Depending On Which Option Was Clicked In Combo Box?

Sep 30, 2013

i have a standard database with tblProducts, order, employees, customers, suppliers etc. i also have a table called tblperson with personID which acts as a one, with the many in three different tables (customers, suppliers and employee) the person table holds data such as first name last name address city postcode and phone. now, ive created a form called frmPerson that acts as a adding data to my database. ive got a load of buttons a working add, delete and a save button, i also have the option to switch through records next, last, end and first. now basically in this form i want to be able to add data i.e. fill out the text boxes and then have a combo box or something similiar that when i add the data i can basically click an option the says 'employee' 'supplier' or 'customer' and then the data gets added to my person table however the difference is that it will also be associated to the record in the wanted table.

View 14 Replies View Related

Modules & VBA :: Conditional Form Formatting Depending On Field

Jul 2, 2013

I created a form that applies conditional formats depending on a field. It works fine, until you enter data into one of the conditionally formatted fields, then all hell breaks loose. Conditional formats totally go away and the cells go to #error.

View 3 Replies View Related

Forms :: Display Row Text From Subform Column In Unbound Text Box Of Main Form

Jan 6, 2014

My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".

View 5 Replies View Related

Modules & VBA :: Combo Box Display Initial Value

Sep 3, 2013

I have 2 Comboboxes, one for Region and one for Country, and am attempting to initalize/cascade them. Here is the basic info for the the underlying tables:

tblRegion
regionAbbreviation (Text, PK)
regionName (Text)
regionOverseer (Text, Foreign Key...essentially a parameter)

[code]...

Some relational constraints of which to be aware:

1. Every Region has at least one Country
2. Every Region has one and only one Overseer
3. An Overseer may be responsible for more than one Region

Characteristics of the Comboboxes:

1. Both use 2 columns with the Name field (first column) being displayed and the Abbreviation or Code field (second column) being the bound column.
2. The nominal case is that both comboboxes will have multiple items to select and in that case the comboboxes are initialed with a query containing a UNION that inserts the string "<ALL>" (same string in both columns).
3. When the case arises that an Overseer manages a single Region or a Region contains a single Country, the Union query is bypassed such that the "<ALL>" string is excluded.

The comboboxes are used to create a filter condition to drill down into a potentially very large recordset.Now to the issue at hand ...

The Region combobox is initialized first. The initialization is accomplished by setting the RowSource property to an appropriate query. The first entry in the item list is then loaded to the combobox Value property by the following line of code:

Me.cbxRegion.Value = Me.cbxRegion.Column(0,0)

This always works whether there are multiple items or just one. If there is just one I set the Enabled property to FALSE; no point in reselecting the only item avaliable.The Country combobox is then initialized in a similar manner using appropriate code that is virtually identical to that used for the Region combobox.The problem I am having is that if there is only a single Country, the Name is not displayed in the combobox but is contained in the selection list. Note that i do not have a problem with the Region combobox when it is initialized with a single Region.

I have searched this forum and others and found similar inquiries and a couple of possible solutions; some clearly don't work while others appear to but result in run-time errors later in the execution of the code (run-time error '2115').I do not have a simply test case I can upload at this time; also new to the forum and appear to be restricted as to my ability to perform uploads.

View 7 Replies View Related

Forms :: Populate Combo Boxes With Values Depending On Selected Value In Previous Combo Box

Aug 5, 2013

I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.

Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...

View 1 Replies View Related

Customizing Field Display Depending On User

Aug 30, 2006

Hi,

I am looking for a way to customize fields to be hidden or not depending on user in forms or reports.

Any idea ?

I wanted to explore the customisation of each query but there must be an easier way to save personal parameters somehow so that the user would go through the forms and hide the non necessary fields once and we would then save somewhere these settings for each user.

Has anybody already experienced such a request ?

View 5 Replies View Related

Queries :: 3 Tables Display Data From 1 Depending On Value In Another

May 12, 2015

I'm building a database to record which books Pupils at my school have read.I have 3 Tables:

Pupils - ID, Forename, Surname, ID
Books - BookID, BookTitle, Author, Level, Genre
Read - ID, BookID, DateOut

I'd like to create a query that shows the BookTitle of the latest DateOut.

View 9 Replies View Related

Modules & VBA :: Combo Box Will Not Display List In Correct Order

Nov 3, 2014

I have code attached to a command button to fill a Combo Box with data from a music collection. A letter of the alphabet is entered into a Text Box then records beginning with that letter are copied from a table, either by Artist or Title. They are saved to a temporary table at which time they are in no particular order. Those records are copied to a further table and saved in alphabetical order. This table is then used to fill the Combo Box.

I used two temporary tables because the records were not displayed in the correct order. I hoped this might cure it, it did not. The records are in order in the table but not in the Combo Box.

Code:
Private Sub Command68_Click()
'SEARCH AND FILL COMBO BOX
On Error GoTo errTrap
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tempList;"

[Code] .....

View 3 Replies View Related

Modules & VBA :: Display Query In Datasheet And Output To Text

Mar 24, 2014

The user will select two dates. Start and End date. The user will hit the run button and the application will read an excel file with employee data and only display/output the records within that date range selected (employment date).

Code:

Option Compare Database
Function DeleteTable()
'Delete old records from AllEmployeesData table
On Error GoTo DeleteTable_Err

[code]....

I am not getting the query displayed on the datasheet after it is done executing. It's just a blank sheet. Also the output file is just this:

Code:
ssn
last
mi
first
employ

I did a quick query test using SQL in Access and it worked fine there. I am guessing my error is somwhere in this section:

Code:
'--Display query result on Datasheet and Output query to text file
With db
Set qdf = .CreateQueryDef("NewHireQuery", strSQL)
DoCmd.OpenQuery "NewHireQuery"
.QueryDefs.Delete "NewHireQuery"
End With
db.Close
qdf.Close
Set qdf = Nothing

[code]....

View 5 Replies View Related

Forms :: Display Different Subform Depending Upon Which Control Is Clicked

Aug 21, 2014

I am creating a database to manage multiple mobile devices. The table structure is complete and I'm trying to build a set of forms.

Simplifying things, I have tblUser, tblSim and tblDevice. I also have a tblJoin where you can select a UserID, SimID and DeviceID to create an item of inventory.

I have created a parent form (frmCreateInventory) base on tblJoin, so it has JoinID and combo boxes for UserID, SimID and DeviceID in the lefthand side.

I have also set up 3 sub forms sfrmUser, sfrmDevice and sfrmSim, based on their respective tables, which I want to display on the right hand side of frmCreateInventory.

I'd like to be able to create a subform control in frmCreateInventory, but change the subform it displays based on what combo box is clicked, e.g. if I click the UserID control, the subform displays sfrmUser, and the relevant data based on the UserID that is linked to the JoinID. if I click the DeviceID control, the sfrmDevice is displayed and the relevant info etc. etc.

Is this possible? if so, how would I go about doing this?

View 6 Replies View Related

Modules & VBA :: CASE Statement - Display Specific Text In A Field Based On Value Of Another

Sep 22, 2014

I have a lengthy CASE statement in my database that displays specific text in a field based on the value of another. Simple stuff but for some reason it randomly will not work on certain values, and never the same one twice. Is there a commonly known cause for this? I have verified that the spelling and spacing etc. are correct in my code so that shouldn't be causing the problem.

View 2 Replies View Related

Modules & VBA :: How To Make A Text Box To Show Results Of A Query To Display On Screen

Dec 4, 2014

We have a button running a SQL query via VBA, how can I make it so the results doesn't show up in a table/preview?Also, I know it's for the SQL forum but how can I make a text box to show the results of a query to display it on screen?

View 8 Replies View Related

General :: Auto Populated Text Boxes To Display Rows From Combo Boxes

Jan 25, 2015

I have strange issue when creating auto populated text boxes which displays rows from combo boxes.

In one database auto populates works with simple text box Control Source edit "=[ComboName].[Column](NumberOfColumn)".

Somehow same method doesn't wotk in different database: here one time I have to insert VBA code at On change Event:

Me.TextBoxName = Me.ComboName.Column(NumberOfColumn)

And other time it wont work with On change but only with After Update Event (code is same).

Another thing this morning happens was that when I tried to add new record trough form where combo box and tex boxes are located, MS Office suddenly stopped working after selecting combo box selection (with message Microsoft Office has Stopped Working). It is 2013 version.

I got it work after deleting and re-inserting VBA code to autopopulate text box at After Update Event.

View 3 Replies View Related







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