Question Regarding 2 Fields In A Combo Box.

Mar 27, 2007

Hi,

I have a combo box acting as a filter for a form which contains data from 2 seperate fields using the following SQL code:

SELECT tblData.Field1 FROM tblData GROUP BY tblData.Field1 UNION SELECT tblData.Field2 FROM tblData GROUP BY tblData.Field2;

This combo box works fine in showing the data from both fields and when I select data from Field1 it gives me the correct results in my form. However when I select data from Field2 i get no results.

I currently have the following VB code and was wondering how I would implement Field 2 into it:

If Not IsNull(Me.cboFilter1) Then
strWhere = strWhere & "([Field1] = """ & Me.cboFilter1 & """) AND "
End If

I think thats how I would get this working? If not, let me know please.

Many thanks.

View Replies


ADVERTISEMENT

Choosing Fields From Combo Box To Make Fields Visible

Aug 30, 2004

I have a combo box linked to a look-up table. There are 8 fields in the look-up table but only if one of three is chosen do I want additional combo boxes to become visible. Do I put the code in the "after update" or "on change" event of the combo box and how do I express the code-

If TechniqueCombo="caudal" or "spinal" or "epidural" then
TextNeedleType.Visible=True

(am I close??)

Thanks

View 4 Replies View Related

Combo Box With Multiple Fields

Feb 8, 2008

Have been searching all morning & can't find solution (technique must be haywire)

Have created a combo box query with 3 fields, id-code-description
Objective is to select Code from combo box and populate Description field from the value in the combo box into another table

Have tried all sorts of techniques, none of which have worked

I am sure this has been answered a million times, but I just can't find it

Any help appreciated

View 7 Replies View Related

Combine Fields Into Combo Box?!

May 26, 2005

hi all,

I have made a form to run reports on a database, however, I need to add a field where the end user can enter an account number and the report will find the relavent fields. The problem is that the account numbers are stored as four different fields within the database (add_char1, add_char5, add_char9, add_char13).

At the moment I am trying to use a combo box on the form to display all of the account numbers, but I have no idea how to do this, I can only get one field of account numbers (eg only entries from add_char1 displayed in the combo box). I have read several of the posts in these forums, but not really found a solution. If anyone knows of a way to display multiple fields as a single column (so that the combo box produces a list including add_char1 to add_char13), or have any other ideas then please let me know!

Cheers

View 5 Replies View Related

Save Two Fields From Combo Box.

Jul 24, 2005

Hi,

I have a Combo Box that contains two fields, the key field (StudentId) and another field (StudentName). As recommended by the Combo Box wizard, I'm hiding the key field so only the StudentName displays in the box. The wizard also allows me to save only one of those fields in my table so I chose the key field (StudentId). Problem is, I need to store both the fields in my table. How
do I store the two fields from the Combo Box in my table? I'm new to Access so I don't really know VBA that well.

Thanks,
Rod

View 7 Replies View Related

Update 2 Fields With 1 Combo Box

Sep 2, 2005

Hi,
Hope someone can help. What I’m trying to do is have a combo box look up values from one table and add them to another. I have used the combo box wizard to look up a value from table1 and add it to table2 but is there a way that it can lookup 2 values and add them to the second table. For instance if I had to tables like :-

Table1
First Name
Last Name

Table2
First Name
Last Name

Can a combo box lookup and update both fields for example if I have a combo looking up the first name can it also lookup the last name and add them to the corresponding fields in the second table but with the user only selecting the first name in the combo box.

I’m sorry if I don’t make much sense I’m new to access and fairly new to forums

Thanks for your help

View 1 Replies View Related

How Do I Create A Combo Box Of Fields

Mar 21, 2006

Hi everyone, first off, I did a search of "combo box fields" and it turned up some results but after going through them, I still didn't think it answered my question.

I want to create a combo box of fields from a table. After selecting a field, I want to choose from another cbo either "Yes" or "No" to fill out that particular field.

How do I do that? Thanks all.

View 5 Replies View Related

Populate 3 Fields From One Combo Box

Mar 27, 2006

I have a combo box on a form that shows 3 columbs from tblparts in the drop down, I wish to select one row from the drop down, that will enter the selected data in three fields on the form.

For example my form has three fields "part code", "Description", "cost".

Part Code = combo box
Description = Text Box
Cost = Text box

I want to select the data from the combo drop down to populate all three boxes.

Can sombody please help, as I have been stuck on this all afternoon. Cheers

View 2 Replies View Related

Combo Box Select With TWO Fields

Jan 28, 2005

I have a database of customers, and I'd like to be able to pull up a specific record on a form. Currently the only way I know how to do this is by ID number (the primary key). I'd like to be able to search by their last name and first name (of course we have people with the same last name), so for instance I'd like to be able to input "Smith" and then have a list of all the smiths to choose from. Is there a way to do this? Thank you!

View 2 Replies View Related

Combine Different Fields To One Combo Box

Mar 8, 2005

Hi Guys,

My table has three fields
pickup_carrier
delivery_carrier
rail_carrier
all the three fields share the same lookup source table.(TblCarrier)
Is there a way i can combine (uniquely) all the three fields to a common combo box with one field to select?

any one help..

Thanks,
BinJos

View 7 Replies View Related

Combo Box And Search Fields

Feb 26, 2007

I have a form that has a combo box that is used to populate data in the detail section of the form, I just added 2 text boxes to search and fill same boxes.
They both work, but
My problem is after you search using the text fields the filter that the search used stays and causes my combo box not to work unless you go into design view and delete it from the filter property.
Any thoughts on how to fix this??
Advance thanks

View 2 Replies View Related

Combo Box Completing Multiple Fields Help

Dec 2, 2005

Ok... big time newbie/hack here. I have a tiny bit of programming experience from waaay back with UNIX and C. Have basic database experience and understanding but no VB experience. So I appologize ahead of time if this seems really simple. I'm working on "fixing" a small access database/program for my wife's work. Very simple design.

I have a company table and a customer table. I have customer form and a company form. They may have several customers at the same company. So my design has them starting on the Customer form. They begin by filling in the Customer's Name and then they get to the Company Name combo box. They should select the Company Name from this box. If it is a new company and is not in the list they should click on the "New Company" button beside the Company Name field. Then the Company Form opens and they can add a new Company along with Company address and phone numbers etc. Then they close the Add Company Form and then can select the newly added Company form the Company Name combo box (by the way, the only way I could get this box to update with the new company name was to use a macro that only runs the Requery statement for the On Enter event... it works... I hope this is ok).

Anyway, this is where my problem arises. I need the selection of the Company Name to also pull over the address, phone number, fax number, etc. info from the Company table and complete it on the Customer form/table now. How do I do that? I think I need to do this with the After Update event with some VB code... but I have no idea how to actually pass this data. The property for my combo box is as follows:
Control Source........CompanyName
Row/Source Type.....Table/Query
Row Source......SELECT zMASCompanies.CompanyName FROM zMASCompanies;

The field doesn't have to be a combo box (if this is not the right way to do it)... I just need them to select a company name and have it fill in about 20 or 25 fields from the company table/form into the customer table/form.

I did try searching the forum and found a few things but nothing I found was very clear (especially since I am not sure I am even heading down the right path). Any assistance would be greatly appreciated!!!

Any help please????
Thanks,
Jeff

View 7 Replies View Related

Combo Box Doesn't Update Fields

Feb 27, 2008

I have a Combobox so the enduser can search and select items for the form below it rather than clicking the arrows for Next/Previous.However I have an issue with DLookup queries.My Combobox is called 'F_ComboBox' (I use F_ in my forms to indicate it's a form textfield and not from a table).My first field in the form, called 'F_ProdID', I want it to select the rows ID from the Combobox option selected. So it's simply:=[F_ComboBox]Which works fine, it shows the ID for what I selected... but when I do this to show my ProductName...=DLookup([ProductName], 'Products', [ProdID] = [F_ComboBox])Or the same but using the first textfield:=DLookup([ProductName], 'Products', [ProdID] = [F_ProdID])It loads once but if I select another item out of the Combobox it doesn't change, it just stays on the last result. So the query works, just doesn't refresh when a new item is picked from the ComboBox.Am I doing something wrong?Thanks,Nick.

View 1 Replies View Related

Using Combo Box Selection To Fill Other Fields

Mar 12, 2005

I am new to Acces programming and have been tasked with making a database for work. I is a very simple database. What I need it to do though that I can't figure out is. Once the table is populated with information I want the user to be able to select a record from my combo box and then all the rest of the information from the record will automatically display in the correct text field so any changes can be made to it. So I have say Combo Box John Smith and when he is selected I want text field DOB to automatically fill with 01/01/1960 as that is what was put in there when he was first entered.

Thanks.

View 1 Replies View Related

Combo Box - Trying To Display Two Fields Unselected

Dec 28, 2005

I am trying to display two fields when the combo box is unselected.

Basically I have a table source manufacturer. This table has Manufacurer e.g. Nokia. Model No e.g. 3230.

So on the combo box i want it to show Nokia 3230. Saves me linking to a subform to show the information.

Can it be done???:)

View 4 Replies View Related

Adding Combo Data To Fields

Mar 15, 2006

I have a Combo Box that places the Address into the given Address field. How can I have it place the second and third cloumns, from the Combo Box into the next two adjacent fields on the Form (Last Name & First Name)?
Please describe in detail, not just code, but where a how it goes. I am new at this thing.

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 Box To Fill 3 Fields On Form

Oct 5, 2006

I have the fields City, State and Postcode in my Member's table. My Member's form has the same 3 fields.

I have the CityLookup table which contains the City name and relevant State and Postcode.

I want my users to be able to either select from the combo dropdown list to select a City or start typing the name and the name will be autofilled from the list - then the correct City name, State and Poscode will automatically fill the fields on my form.

i have looked at a number of combo box methods and can not get one to work for me.

Any help would be appreciated.

View 5 Replies View Related

Populate Form Fields From A Combo

Jul 30, 2005

Trying to update fields (bound) on a form (built using the wizard) from value selected in a combo box. I can get this to work with unbound text boxes using an After Update event handler and a code query along the lines of:

Me!TxtJobCode1 = Me!CboJobDesc.Column(1)

But this doesn't work where the form field is bound to a table.

So qu is - how do I achieve the same result using table fields instead of text boxes?

I could use text boxes but not sure then how I can save that data as a record in the table if it is not bound to fields.

Any help appreciated

Andy

View 1 Replies View Related

Forms :: Filter Two Fields Using Combo Box

Jan 15, 2014

In Dec 2013 I created an Access table "Donations" that contains fields regarding charitable donations (Date, Donor, Amount). I use an Access form "Select Donor Form" to select a specific Donor (via combo box) from the table. Then an Access Query "Select Donor Query" uses the Donor selected from the combo box in the form to display all of the donations from that Donor for the year as an Access report.

Since I just created this Access table last month, it only had data from 2013. Now that we are in 2014, in preparation for when I run this report next December, I obviously need to modify "something" to clarify that I want the donations from a specified Donor for a particular year (i.e 2014, 2015, 2016, etc.).

I added a field to the Access table called "Year". I probably can derive the year from the already present "Date" field, but sadly, I don't know how to do that. I want to simply edit the existing combobox in the existing form to return Donors that have a record in the existing table where the Year = 2014. That way, the only changes I will need to make over time is to update which year I need and all of the Donors for that year will populate in the combo box.

Below is the Access macro belonging to the combo box in the form. I converted the macro to Visual Basic. What to add to select the Donor for a particular year. You can see that right now it is only selecting "Donor Name" without regard to which year the donor has a record.

'------------------------------------------------------------
' Combo3_AfterUpdate
'
'------------------------------------------------------------
Private Sub Combo3_AfterUpdate()
On Error GoTo Combo3_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[Donor Name] = " & "'" & Screen.ActiveControl & "'"

[Code] .....

View 9 Replies View Related

Tables :: How To Add Fields Not Listed In A Combo Box

Oct 5, 2012

I have a list box with 5 items and need to design an option for a user to add a value that is not listed. how will the new fields be added to the table?

View 1 Replies View Related

Forms :: Comparing Combo Box Value In Fields

Jun 26, 2013

I have form where some or more field exist. I want to compare two field as :

1. cboBatchID As Combo box
2. txtBillNum As Text Box

Private Sub cboBatchID_AfterUpdate()
If Me.cboBatchID.Column(4) <= 0 Then
Me.txtBillNum = 1
Else
Me.txtBillNum = CLng(Me.cboBatchID.Column(4)) + 1
End If
End Sub

I mean, if cboBatchID.Column(4) <=0 then txtBillNum start from 1 automatically or cboBatchID.Column(4) >=0 then txtBillNum = cboBatchID.Column(4)+1

I'm already trying with the code above. But does not work. Generate run time error.

View 14 Replies View Related

Use Combo Boxes Or Include Actual Fields

May 6, 2005

I am using a datasheet to show company info -

I have a field countyID which is a code field and a lookup table County

I want to show the text for county on the datasheet, should I base the datasheet on just the company table and use a combo to get the county text - or should I have query that brings in the county text.

Could the experts tell me the "correct" way of doing this?

What are the performance issues of the two methods. Is which method I choose dependent on how many records are in the lookup table?

Thanks Paul

View 9 Replies View Related

Multiple Query Fields & Combo Boxes

Jul 11, 2005

Hi all,

Im trying to do the following query work.
I have a form, with combos , text fields which are filled in with parameters.
The query I want to make is complex.
For example we shall use field1, field2, combo1 , combo2 for explanation.
I want the field1 param AND the field2 AND combo1 AND combo2 to be evaluated for a result. At the same time, I want the user to fill in only field1 and combo1 or like that and the result to be right.
Is there any possibility to make them all work at the same time, individually, or in combinations ?

Sounds too Complicated ?

I ve managed to make it work only by filling in individually the fields or combos and have the right results. The other ways didnt.

Desperately need your helpppp. :rolleyes:

THNK U

View 1 Replies View Related

Link Cascading Combo Fields To Table

Mar 1, 2005

This is my first attempt with cascading combo boxes (2) and with the help of the forum I've made it work BUT, I feel like an idiot because I'm drawing a complete blank on how to link them back to a "main" data table.

The example I used as a reference was to create them as unbound boxes while using queries to pull for each of the combo boxes. I have 4 tables. One will serve as the main table while 3 others are each feeding one of the combo boxes. I went back and set the main table as the record source and added some of the other fields but those unbound fields have me stumped.

If anyone recognizes an earlier post that clarifies this, please let me know. I've looked through numerous posts but haven't found one yet.

Just like everyone else, any help would be greatly appreciated.

mike

View 1 Replies View Related

Modules & VBA :: Automatically Fill In The Fields Using Combo Box

Jun 10, 2013

I have a form (Project Form) with (Project_ID,Applicant_ID,Project_description, etc). To make it easier for the user who may not know the Applicant _ID when he/she is adding a new project for the applicant, I want to put a combo box with the Applicant Names in it, and once the Applicant Name is chosen, the Applicant ID will be filled out automatically and be saved in the Project Table.

My Approach so far was adding a combo box with two columns(Applicant ID, Applicant Name), and basically adding the following code:

Private Sub Combo36_AfterUpdate()
Me.Applicant_ID = Me.Combo36.Column(0)
End Sub

This approach works well, when I select an applicant, the Applicant ID will pop up correctly. However, This ID is not being saved in the Project Table.

View 2 Replies View Related







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