Queries :: Combobox Items Hidden Based On Table Field

Nov 17, 2014

I have a combox with the following query in its RowSource: SELECT [Error Codes].[ID], [Error Codes].[ErrorCode], [Error Codes].[Active] FROM [Error Codes] ORDER BY [Error Codes].[ErrorCode];

I now need to change the query's Rowsource via code and so far I have figured out that this works:

Code : Forms![frmAcceptReturn].Form.cmbErrorCodes.RowSource = "Select ID, ErrorCode FROM [Error Codes Missing]"

However, the table "Error Codes Missing" also has a field called "Active" which I need to take into account; If the error code is not active then it should not show up in the combobox.

I know how to do that in the original RowSource, but how do I do it with code?

View Replies


ADVERTISEMENT

Design Problem - Filtering Combo Box Items Based On Related Table Field

Apr 19, 2007

Hi im stuck on filtering a combo box (i am using an sql query to populate a combo box with a filtered selection, this is in Access but im after some design sanity checking). I have users who can be assigned a category. Jobs can be assigned a category and also have a list of people working on that job (in the JobDetails table). I have the following tables:

Categories Table:
CategoryID (PK)
Description


Users Table:
UserID (PK)
Username
CategoryID (FK on Categories.CategoryID)


Jobs Table:
JobID (PK)
CategoryID (FK on Categories.CategoryID)


JobDetails Table:
JobID (FK on Jobs.JobID)
UserID (FK on Users.UserID)

Then in the job details when listing users for a job (many users can be for one job) i would like to only show the users which have the same category as the jobs category. Is this possible? i tried the SQL below for the lookup column field JobDetails.UserID but it doesnt work:

SELECT Users.ID, Users.Username, Users.CategoryID
FROM Users, Jobs
WHERE (((Users.CategoryID)=[Jobs].[CategoryID]));

All the tables are linked with relationships but my SQL isnt so hot!
Any ideas as to how i would do this and get it working?

Even if it can be done, is this even recommended? I can see funny conditions happening if the job details category changes or the users category changes then even if they are existing in the job details list they will not be shown? Even so, i would be interested in the above to know how it is done (if possible).

Thanks in advance,

Chris

View 2 Replies View Related

Queries :: Criteria Based On Combobox From Another Table

Nov 25, 2014

How to get my query to run from criteria based on a combobox from another table. I have a field "prac" that has entries such as JF, MG, PM, RJ etc.

My query has the criteria for prac as [Forms]![PracReportPrint]![PracChoice].

PracChoice is the name of the combobox.

If I specify a valuelist for the combobox the query works. I created a different table just for a list of practitioners that contains only an index key and practitioners (JF, MG, PM, RJ, and so forth). When I set the combobox to table/query and select practitioners from my other table I get the correct list,b ut the query doesn't seem to detect what is selected from the combobox.

View 2 Replies View Related

Forms :: Using ComboBox To Look-up A Multivalued Field And Select Items In Listbox?

Jul 21, 2014

I'm creating a Form called Pharmacy where I can select a [Diagnosis] from a combo box in the form. This combo box source references a table called tblDiagnosis where each Diagnosis also has a multi-valued field called [Indications].

The Pharmacy form also has a multi-select listbox with all possible Indications. I would like to write a VBA code such that when a Diagnosis is selected, the Indications for that Diagnosis are automatically selected/highlighted in the listbox on the form as well.

As such, by selecting a Diagnosis, all the indications attached to that Diagnosis will automatically be selected; however, if additional indications are needed, they can still be selected afterward.

I know that there is a function Me!Listbox.Selected(i) = True, where i is the row of the entry in the listbox. However, the i in the listbox does not correspond to the ID of the Indication. I think that if there is a way to select listbox items by name, that would be much more efficient.

The reason I have a listbox, is because this listbox of Indications then references another table called tblDrugs where all drugs that are approved for the selected indications selected are filtered and displayed.

View 1 Replies View Related

Queries :: Format Field As Password Or Hidden Text

May 22, 2014

I have a query that I am sending as a spreadsheet to various service technicians listing parts that they need to take inventory of. Then, after they take the inventory, they send the spreadsheet back to me and I upload their counts back into my database. Right now, my query contains the Bin number, part number, part description, and a blank column for the technician's count. I have just learned, that the company does not want the Bin number to be visible in the report. In order to upload the technician counts into the database when they return the spreadsheet, I need to be able to reference the Bin number to get the count on the right line.

Is there something that I can do so that the Bin number will be visible in the report when the database reads it, but not to the technician?

The only solution I could think of was to format the Bin Number as a password. Unfortunately, I can't get that to work in the query results. If I save the bin number as a password in the table, is there a way to make it visible on reports for internal use (so the people in headquarters who are responsible for over all inventory can still see each bin number)? I found how to hide the field in the query results. However, when I send the results to the technician, the field is not there at all.

View 5 Replies View Related

Forms :: Change Items In A Combo Box Based On A Field

May 29, 2014

So I have a combobox that pulls values from a table. I am being requested to do an update to the database which means that I have to filter some values on that combobox based on a field on a previous form.For example:The main form is called "frmcontacts" and has a table field called "txttypeofcustomer" which can have two values: "customer" or "dealer".

The form that contains the combobox is called "frmnewissue" the combobox is called "cmbissuetype". "frmNewIssue" is opened through a button on "frmContacts". This combobox pulls the values from a table "tblissuetype". The values in that combobox are then: "Repair" "Return" "Question" "Replace".

If the value on txtTypeofCustomer is "Dealer" then all the values for the combobox remain visible. If the value of txtTypeOfCustomer is "Customer" then "Replace" cannot be visible or has to be greyed out.

View 6 Replies View Related

Combo Box To Add Data Items Based Upon Table

May 13, 2005

I have a small database, that I would like to use a combo box to allow user to select a value based upon values already entered on table, and then if value is not found enable the user to enter a new value that will then become part of the selection for future record adds.

View 1 Replies View Related

Percentage Based On Count - Table With Name And Items Of Report

Sep 19, 2012

I have a table with the name of a report, the items on the report, and the number of items on the report. I would like to count the instances of the names of the individual reports that appear on another table and then divide that count by the number of items on the report.

View 1 Replies View Related

Forms :: Adding Value Of Combobox To Hidden Column When User Enters A New Record

Aug 14, 2013

I'm very new to access so I'm not sure about the correct way to go about this. I have a table with a 'category' column, a form which hides the category column, and a combobox to filter the category, let's say R, C, and F.

What I want accomplish is to have the value of the comobox applied to the hidden 'category' column when a user enters a new record into the form.

Is there I way I can get an instance to the record as it's being entered and modify the data using VB? Or would I have to write a sort of pop() function and have it run afterInsert and then modify it that way? Can I even alter the table using VB like this?

View 4 Replies View Related

Form Based On Queries - Deleting Field From Main Table

Mar 28, 2014

In my Access2000 db, I have a table, on which many different queries are based. Many forms are based on those queries. I want to delete some redundant fields from the table. I tried deleting one, but I found I could no longer open any of the associated queries and forms. Is there a simple way to delete table fields so that it doesn't stop me from opening associated queries and forms? (There are hundreds of them, and I have a lot of table fields that I want to delete).

View 1 Replies View Related

Queries :: Dynamic Query Based On A Form (ComboBox)

Jan 22, 2014

We have a ComboBox on a form with the months: Jan, Feb, Mar, Apr, etc.

We have fields in a budget table named: Jan, Feb, Mar, Apr, etc.

We want to create a query that pulls the correct field based on the value in the combo box.

This is what I have that doesn't work:

MyField: [Query1].[SumOf] & Forms![Main Menu]![test]

How to do this?

View 4 Replies View Related

General :: Populating Field Based On Combobox Selection?

Oct 29, 2013

I have a table of raw materials that have two fields, their stock code and longer description.

I have another table that is tracking the usage of these materials. I want both the stock code and longer description to be recorded in the usage table.

I want the "Description" field in the usage table form to auto populate when the user selects the corresponding stockcode from a combobox.

View 3 Replies View Related

Populate Attachment Field Based On Combobox Selection

Jan 8, 2013

I am creating a Database to track product details and inventory for items we purchase.

I have several Tables and several Forms already working properly, except for one thing.

I have a Form called "Lights", and it contains a ComboBox called Light_Name and 6 TextBoxes: Manufacturer, Model_Number, Cost, Weight, Light_Type, Notes. It also has an Attachment Field linked to the same table.

I am using the Code:

Me.TEXTBOX = Me.Light_Name.Column(#)

to populate the Textboxes with the relevant info from the Light Table.

This works for every Textbox I have.

However I cannot get the Attachment Box to change. And when I try to add code to it I get a debug error. The Attachments are PDFs and I need them to show based on the ComboBox Selection.

I have tried the same code as above, and as I said, it gives me an error.

View 14 Replies View Related

Queries :: Creating Unmatched Query Based On Selection From Two Combobox

Apr 15, 2013

I created 2 combobox that list specific table in a data base. I want to create an unmatched query based on the selection from those two combobox.

All field in those table are the same.

View 3 Replies View Related

Filtering A ComboBox List Based On A Table Value?

Nov 12, 2014

My database is centered on a main form where users select pieces of information from ComboBoxes (primarily) and submit.

The first part of the form, they must choose from a list of our clients, which is a table with with roughly 5000 rows.

Later on in the form, they must choose a contact person from that client. While Client's may have several contact names (which need to be stored in a table), only one name is necessary for the form portion.

How can I make this Contact Person ComboBox only load names attached to the specific Client selected above?

As it stands right now, the Client List has its own table (along with additional information), and Contact Name is a separate Table with a look up field of Client List.

View 1 Replies View Related

Queries :: Search Or Some Items On A Table

Mar 24, 2015

I have made a query to search for some items on a table. I want there to be a button on the search form that says 'search' and takes you to the corresponding page on the form. (The form has multiple pages in, all with different products on) Is this possible?

View 4 Replies View Related

Autofilling Textboxes With Table Data Based On A Combobox.

Nov 17, 2006

I am creating an Access program for logging in Parcels that are delivered and I am having some problems.

I have a Table called 'Contacts' and within this there are 4 Columns: 'Names', 'Departments', 'Extensions' and 'Emails'.

I also have a Form and there is 1 Combobox and 3 Textboxes relating to this Table: 'Addressed To', 'Department', 'Ext Number' & 'Email'. (see http://c0ld.homeip.net/parcel_log.jpg for details).

What I would like to do is select the Name from the Combobox (Addressed To) and the have the other Textboxes (Department, Ext Number & Email) get auto-filled with the corresponding data that’s within the Table for that Name.

If anyone would like the .mdb for this, please PM me.

Thanks for your help in advance.
Ross Hurrell

View 7 Replies View Related

Complete Newbie.please Help With Enabling/disabling Field Based On Combobox Selection

Oct 24, 2006

Hi everyone,


Firstly apologies for posting what is likely to a really simple problem and probably has been explored before. I have been looking through other treads but nothing that I could identify really fits the bill.

Essentially based on choices made against a combo-box, I wish to lock or hide combinations of fields/combo box within the form. Realistically I want to lock rather than hide.

All the fields/combo boxes in the form I want to effect are bound.

I can effectively do this as long as the fields/combo-boxes are unbound, but it seem to fail when they are bound.

Any assistance would be really helpful so thanks in advance.

View 3 Replies View Related

Removing Items From Combobox!!

Oct 20, 2006

I have a combobox(cmb_periode) which I am populating with a querry when I select a value from another combobox(cmb_periodicite).

This all works well, but I have a problem when I want to remove the items from the combobox(cmd_periode).

Its a little wierd cos it deletes the first record and gives me an error saying that the 2 is not found.

My code is given below...

Private Sub cmb_periodicite_Click()

For hasItem = 0 To cmb_periode.ListCount - 1
cmb_periode.RemoveItem (hasItem)
Next hasItem

id_per = DLookup("id", "periodicite", "libelle='" & cmb_periodicite.Value & "'")
Set rs = CurrentDb.OpenRecordset("SELECT periode.libelle FROM periode where [periode].[id_periodicite]=" & id_per)
With rs
While Not .EOF
stringItem = rs!libelle
cmb_periode.AddItem (stringItem)
.MoveNext
Wend
End With
Form_indicateurMesure.Requery
rs.Close

End Sub

View 1 Replies View Related

Selecting Multiple Items On Combobox

Nov 23, 2006

Hello to all .

Have you got any idea ?

I have a List Box in a table and it is set to permit multiple items selection
from it .

The fact is I can select, as I wanted, multiple items from it through
the Form but when I go to the correspondent table to see the results
the selected data from the List Box isn't there .

Note all data selected from the List Box is visible trough the Form but
not the table .

Has this problem anything to do with mismatch in data type configuration on the table ?


Lots of thanks in advance

Miguel

View 1 Replies View Related

Forms :: How To Exclude Items From A ComboBox

Nov 29, 2013

How do I exclude something from a ComboBox?

My form is a profile of a dog and contains a Dog_ID. The ComboBox is a list of dogs names and shows all the females I want it to show all the females less the female that it is being linked with.

View 1 Replies View Related

Using Combobox To Show Only Remaining Items?

Sep 18, 2015

I want to use combo box to select the resources to assign, but want to only show the remaining item, each time I click for new record.for example staff allocated for different jobs.

seat assigned to each person, so each time the free seats only be displayed in the list, Not the already assigned.

View 2 Replies View Related

Modules & VBA :: Device Table - Warning Message Based On Combobox Selection

Jul 26, 2013

I have a combobox with several options for a device's parts. When one part is selected, it gets added to a device table.

ComponentCmb
Generator A
Generator B
Gearbox A
Gearbox B
Blades A
Blades B
Blades C
Tower A
Tower B

I want to display an error message if an option is being selected more than once.

For example, if a gearbox has been chosen, then another gearbox cant be chosen too.

How do i display this warning message.

View 3 Replies View Related

Modules & VBA :: Table With 3 Fields - Warning Message Based On Combobox Selection

Jul 29, 2013

I have a table (ComponentT) of different device components a user can select from ( generators, gearboxes, etc.)

The table has 3 fields - ComponentName, ComponentType, ComponenentDetails

I have a query returning all the ComponentDetails values.

I then have a combobox that uses this query as a row source.

The user can select different components they want from the combobox. Once something is selected, it is added to a new table - UserSelectedComponentsT

As a device can have only one gearbox or one generator etc. I want a warning messagebox to be displayed if the user tries to select a generator from the combobox when one has been previously selected.

View 1 Replies View Related

Modules & VBA :: Show Hidden Tabs Based On List Box Column Value

Mar 30, 2015

I am designing a contact database for a diocese and the contacts record form is divided into several tabs, some of which are hidden by default. One of the controls on the form is a listbox (lboRoles), where a user can add one or more roles to contacts. The listbox has a hidden column that defines the TabIndex for the assigned role, and my goal is to make the associated tab on the form that was previously hidden, to now be visible.

For example, if a contact is assigned the role "Committee Member" and the tabindex value for that role is 3, the form should make the hidden tab (where the page index is also 3) now visible.

View 13 Replies View Related

Forms :: Update Row-source Of Combobox Based On Value Selected On Another ComboBox?

Apr 26, 2015

I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.

Code:

Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub

But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?

View 5 Replies View Related







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