Modules & VBA :: Combo Box Query Field Selection

Jul 31, 2014

I'm trying to write a query to allow the user to search through records.

To make the interface simple I just want a combobox to select the search field and a text box to enter the search string.

My problem is trying to build a query where the value of a combobox on a form is used as a field in the query.

View Replies


ADVERTISEMENT

Modules & VBA :: List Box Respond To Combo Box Selection

Dec 11, 2014

I am using access 2010

I am trying to get my list box to filter based on the selection of a combo box.

My Combo box cboOrgRole is on my main form and is bound to OrgRoleID - on form - frmOrgEntry

The unbound list box lstRoleList is in a tabbed subform - frmPersonnel

This is my data pull for lstRoleList

Code:
SELECT tbl00PersonRole.PersonRole, tbl01Orgs.OrgRoleID
FROM tbl00PersonRole INNER JOIN tbl01Orgs ON tbl00PersonRole.OrgRoleID = tbl01Orgs.OrgRoleID
WHERE (((tbl01Orgs.OrgRoleID)=[Forms]![frmOrgEntry]![OrgRoleID]));

This is the code I have on cboOrgRole AfterUpdate

Private Sub cboOrgRole_AfterUpdate()
Me.frmPersonnel.lstRoleList.Requery
End Sub

I have also tried Recalc - both throw a Compile error: Method or data member not found

My goal is to be able to select the role of the organization, (General Contractor, Architect, Engineer, or Client) and have it list the available titles for the specific organization type.

My "00" tables are library tables

View 12 Replies View Related

Autofill Field From Selection In Combo Box

Jul 27, 2005

Hi all,

I am fairly experienced with Access but am stumped. I have a table with a primary key ID field, product name, and product price. On an order form, I want to select the product from a combo box and have that product's price automatically populate a text box beside it for further calculations. Any help would be much appreciated, thank you!

View 14 Replies View Related

Updating Another Field Upon A Selection From A Combo Box

Feb 28, 2008

Hi,

Im trying to get one of combo boxes to update a field automatically.. There are two choices in this combo box "Gatwick" and "Woking" what i need is when one is selected the JobNo field will update itself to GWO-(the first Unused JobNo) Ive used some VBA to make atleast the GWO- or WWO- appear and it works, but i have no clue as to how to get the next unused order number to appear after it.

This is what i have so far:

Private Sub JobLocation_AfterUpdate()

If Me.JobLocation = "Gatwick" Then

Me.JobNo = "GW0-"
Else
Me.JobNo = "WWO-"
End If

End Sub

Any help would be greatly appreciated.

Cheers

Marc.

View 4 Replies View Related

Modules & VBA :: DLookup Fill Textbox After Combo Selection

Apr 29, 2014

I'm a novice when it comes to Access 2010, and I'm having trouble with DLookup syntax, and am going nuts. I have tblLookup, tblFees and Costs, and frmFees and Costs. All data entry is done in frmFees and Costs.

The tblLookup lists plaintiffs and the matter related to them. In the form, I made a combo box [Combo13] for plaintiffs and a text box for Matter [Matter], but whenever I enter the plaintiff, I get an error.

The error is:
Run-time error '3075':
Syntax error (comma) in query expression '[PlaintiffName]=The Plaintiff I Typed in'

The code I'm trying to use:

Private Sub Combo13_AfterUpdate()
Me.Matter = DLookup ("[Matter]", "tblLookup", "[PlaintiffName] =" & Me.Combo13)
End Sub

[PlaintiffName] is the column name in the tblLookup.

I looked around the forums but couldn't find anything that matched my setup.

View 3 Replies View Related

Help With Combo Box Selection Being Determined By Entry In Another Field

Feb 7, 2008

first of all, i'm new to access. the only experience i have with it is reading the "microsoft office inside out", access section, and doing some research on the web.

i work for a school district and my boss has asked me to make a database with all our assets. i used to have everything in excel, but he prefers access, so here i am. what i'm wanting help with is making a combo box that lists manufacturers like hp, dell, etc., and then having the next field show a list of models depending on what was selected in the manufacturers field. so if i select dell, i want only dell models to show up in the combo list for models.

i can make the combo lists, but i don't know how to make it so that the entry in one field affects the list in another field. i've tried putting in lookup values, i've tried doing it with expressions in queries, and a few other things. i've tried searching google, and the forums and i've found things that are kind of similar to what i want, but doesn't do exactly what i want. so here i am...is there a simple way to do this? this isn't required of me, but now it's driving me crazy because that's the way i'd like to have it but i can't figure it out.

i'd appriciate any help with this.
thanks.

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

Field Values Based On User Selection In Combo

Dec 9, 2005

Hello,

I'm stuck! I want to create a form which has a combo box where you select
someone's name, and their address appears in another text box on the same form. The names and addresses are in a table called "cardholders".

I'm doing separate combos for first name, surname cos I think that's the only
way you can do it.

The fields in the table are credit_add, credit_name & credit_surname. The combos are called "cardholder name" "cardholder surname" etc. This is the code in the text box where I want the address to appear:-

=DLookUp("[credit_add]","cardholders","[credit_name] = '" & [cardholdername] & "' And [credit_surname] = " & [cardholdersurname])

Can anyone help?

Thanks.

View 3 Replies View Related

General :: Default Value Of Text Field With Selection Of Combo Box

Sep 9, 2014

In the database attached I have a form called from Candidates.In this form is a combo box where a user can select what company the candidate belongs too.

However some candidates are Private Individuals (do not belong to a company).Therefore, I want the Position field to be set to 'n/a" by default if 'Private Individual' is selected.

View 9 Replies View Related

Forms :: Multiple Field Population On Combo Box Selection

Nov 4, 2013

I'm building a test registration form, and I want to populate 2 additional fields based on the TestID ComboBox selection. This same TestID table has a Requirement and Expected result field, that I want to display for the end user, to make sense of the test in question. Multiple fields in the ComboBox does not work since you cannot select a single testID; you can click on the relevant testID, but the table remains in view, rather than displaying only the relevant testID.

View 7 Replies View Related

Forms :: Hiding Field Depending On Selection Of Combo Box

Jan 28, 2014

I have a form which has a combobox where the user selects a record from another table,I want to hide the forms fields [managercontact] and [managertelno] depending on the value of the combobox (manager) from the table details, but its not the value shown in the combobox its the value of another field [type] from the same table called details. Its one of two values being 'conc' or 'ob'.

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 :: 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

Modules & VBA :: Make Selection From A Combo Box Populate That Number Of Metals Fields?

May 27, 2015

My database will be creating quotes based on employees entries. Each quote will be unique because of the part. Each part has the potential to have Precious Metals, and Base Metals included. The employee must select the number Precious Metals and Base Metals that a particular part has. The problem lies with what happens after this selection is made. There are three fields that need to be defined pertaining to each metal. I need the number selected to determine how many fields to make available. If there are two precious metals, I need to make the three fields available twice; one for both metals. I have the possibility for up to 5 Precious Metals and 10 Base Metals per part. How can I make the selection from a combo box populate that number of Metals Fields?

View 14 Replies View Related

Modules & VBA :: Populate Data Sheet Subform Based On Combo Box Selection ALL

Aug 20, 2013

I have an unbound combobox on a form that is used to filter the records of a subform based on who they have been assigned to. The combo box is based off of a query to the personnel table and utilizes a UNION querry to add the option "**ALL**" with a id number "111111" as the first option in the combo box.

In other words: the combo box has a list of names to choose from and the word "ALL" at the top as the first selection. The idea is that when "**ALL**" is selected, the subform should display all records regardless of who they have been assigned to. I'm trying to accomplish this with VBA. I've started developing the code to try to impliment this, however currently when "**ALL**" is selected, I'm getting a datatype missmatch that seems to be caused by my use of recordset.

Option Compare Database
Option Explicit
Private Sub cboTaskListName_AfterUpdate()
'On Error GoTo cboTaskListName_AfterUpdate_Err
Me.Refresh

[code]...

Also once the queried records are saved into the record set, how can I communicate that to the subform so that it displays them?

View 2 Replies View Related

General :: Auto Populate A Table Field From Combo Selection

Jan 17, 2013

I have a Table (tblFPAData) that is being populated with entries from a form I created. There are several fields but if I can get an answer for one relationship then I can repeat it for the others.

In tblFPAData there are the fields MaterialNo and Description.

I am creating another table called tblSchedule and using a form to enter the information. I need the user to select the MaterialNo from a combo (cmbMaterialNo) and the then table auto populates the Description from tblFPAData.

View 3 Replies View Related

Autofill Text Field Using Combo Box Selection To Generate Autonumber

Dec 10, 2013

Autofill text field using combo box selectionHello,

I'm trying to autofill a field on a form using MS-Access 2010 Web version sharepoint using macros without coding.

The form has an existing Combo Box field called Segment, using the row sources "REW", "WTT", "DBM".

A user begins filling out the form and eventually selects the Combo Box for Segment and selects any one of the segment no Multiple selection

There is another text field, which is actually alpha-numeric, called Job_No. I want this to autofill based on their Segment selection, using this format:

REW-YYMMDD-TTTT, or REW-131210-20001 for example, for today with the time displayed as military time and last Job No.(20001) for REW and Also for WTT (30001) as starting number.

View 1 Replies View Related

Forms :: Auto Populate Date In Field Based On Selection In Combo Box

Mar 11, 2015

I'm creating a form that when the user selects the following categories in the same combo box (Date Received, Date Reviewed, Date kitted, In Work, Complete) it auto populates dates in the respective fields. As I mentioned, it's only one combo box. The dates will be spread out, so the user will change the combo box selection based on when these events occur. I already have a field for each category both on the table and form. Also, I do have multiple tables for other parts of data, but these categories all fall into the same table.

View 8 Replies View Related

Combo Box Selection For Query

Feb 13, 2006

I'm new at Access 03. I have a combobox that is sourced by a table, Rowsource property is:

SELECT Classes.TableID, Classes.ClassID FROM Classes;

The name of my combobox is "ClassCombo".

I'm trying to generate a report based on my combobox selection, but I can't reference the value of the selection. The query tied to my report has the following SQL:

SELECT ClassesForInstructors.ClassID, Instructors.InstructorID, Instructors.FirstName, Instructors.LastName
FROM Instructors INNER JOIN ClassesForInstructors ON Instructors.InstructorID = ClassesForInstructors.InstructorID
WHERE (((ClassesForInstructors.ClassID)="[Forms]![School]![ClassCombo]"));

I'm trying to grab the "ClassCombo" value as input to my query, but it's not working. What am I doing wrong?

Thanks!

View 2 Replies View Related

Running A Query By A Selection From A Combo Box

Dec 10, 2007

I have a query that runs info selected from safety visits. I have made a form with an unbound combobox that selects the supervisors name and after the name is selected, I have a button to run the query. When a name is selected, the query comes up blank. When I do not select the name, the query is populated.

My criteria on the query is [forms]![personnel]![combo9]

Combo9 is the unbound dropdown menu with the supervisors name that is taken from a table of names.

Any help?

Thanks in advance.:(

View 1 Replies View Related

Using A Combo Box Selection For Query Criteria

Nov 1, 2006

I have a report that is based on a query. In the query, I have a field called "Mode". In the criteria section for the Mode field, I am calling the selection from a combo box on a form called "frm_main". So the criteria for the Mode field is "[Forms]![frm_Main]![Mode_ComboBox]". This combo box has selections for 1,2,3,4,5. I want a selecton on the combo box that will work with the query to show all modes. Sometimes something weird gets entered into the database like "NoMode" for example. I have tried adding a combo box selection of "*" , "Is Not Null" and "". If I manually type these into the criteria section of the query, it works fine. But when I use these in the combo box and call the combo box selection from the query, it does not work.

Does anyone have any idea what I can use in my combo box selection that when selected, the query (and hense report) will show all data?

Thanks,
Jim

View 5 Replies View Related

Using A Combo Box Selection To Populate A Query

Nov 26, 2004

I have 2 questions which are linked. I am trying to run a query based on a selection from a combo box. Would someone be so kind to indicte if i need to use VB or can i do it directly from Access?

I have made the query and the combo box table but i am unable to get the combo box selection to be used in the query.

Additionally i want the query to look at a date range. In the query criteria i use "=now()" but i want the combo box selection to populate the rest of the criteria so it look like =now()+ XXX where XXX = a number of days, eg 14 or 30.

Any help would be gratefully received.

View 2 Replies View Related

Modules & VBA :: Time Field Selection

Jun 11, 2013

I have a table with several fields including the following 3 fields:

dtmAppoint Date = stores appointment date
dtmAppointTime = stores appointment time
lngAppointDoctorID = stores doctor's id for specific appointment

When I enter a new appointment, I want to know whether a specific combination of these 3 fields already exists. The doctor is actually a dentist and maybe another appointment has already been placed for the same dentist on a different chair. Creating a recordset as indicated below works but I am having some problems with comparing Time (dtmAppointTime). The following works but I need to extract Hour, Minute and Second and put it into string variable strTimeDum.

Code:

rstSearch.Open "SELECT * FROM tblAppointment " _
& " WHERE (clng(dtmAppointDate) = " & CLng(rst!dtmAppointDate) & " )" _
& " AND (dtmAppointTime = #" & strTimeDum & "#)" _
& " AND (lngAppointDoctorID = " & lngAppointDoctorID & ");", CurrentProject.connection, adOpenKeyset, adLockPessimistic

Any way to retrieve the records that correspond to the specific time or a simpler way to access the records of interest?

View 10 Replies View Related

Refreshing A Query Based On A Combo Box Selection

Dec 1, 2004

I have a form on which i make a selection. This selection then populates a query which in turn generates a report. The problem that i have is that when i go back into my form and make another selection the query, and therefore the report, holds the original data.

My question is how can i refresh the selection and therefore produce different reports based on this selection without exiting the application?

Many thanks for any help provided in advance.

View 4 Replies View Related

Forms :: Combo Box Selection With Multiple Query

Feb 18, 2015

I have created form with multiple tables field in some of these fields I have assigned the combo box selection the total combo boxes in form is four and all are unique numbers but this form is incomplete.

1.When I select or update any of four combo box then remaining combo boxes and fields on form should be updated automatically with related records.

2.I need to bring calculated fields from multiple queries on to my current form .how I can insert query fields in to form...

View 1 Replies View Related

Queries :: Run Query Based On Combo Box Selection On Button Click

Jun 25, 2013

I am currently working on an existing database (not created by me) which contains several queries. Each query relates to a particular product.

I am wanting to create a form which has a combo box so that a user can choose a particular product from the combox options and then click on the command button to run the correct query.

How to do this. I have created the form and the combox (together with the list of products). I just need to know what Event Procedure code I need to enter to programme it to look for the correct query and then run it.

For example.

I have the following queries
product1query
product2query
product3query

I have the following options in the combo box
product1
product2
product3

How do I get the command button to look at the product1 option in the combo box and then find and run the product1query.

View 9 Replies View Related







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