Find Record Based On Combo Box

Mar 17, 2005

Hi

I have a search form with 1 combo box and a button which when the user inputs an invoice number and clicks the button, a main form is opened for that particular record.

The problem I have is to display an error message before the main form opens if the user has either left the combo box blank or they have input an invoice number that doesn't exist.

This feels like it should be easy......!

Thanks for any help

Georgina

View Replies


ADVERTISEMENT

Find A Record On Form Based On Value Selected In Combo Box

Jun 2, 2014

I am trying to add a combo box into a form and when the Combo Box wizard pops up I only get two choices:

I want combo box to get values from another table or query. I will type in the values I want

I want the third option...

Find a record on my form based on the value I selected in my combo box.

Why am I not getting the third option??

View 1 Replies View Related

Find Record Based On Cbo Box

Jun 6, 2005

I have a combo box that displays LastName FirstName.

If I have two people with the same lastname it finds the first one in the table w/ that last name. Please help with my code so it searches by firstname and last name. Thanks in advance.

Kacy

' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[Contact_LastName] = '" & Me![cboContact] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

View 4 Replies View Related

Modules & VBA :: Find A Record Based On Primary Key

Sep 6, 2014

I got this function which is supposed to find a record based on the primary key, and then give three fields a value if they should be empty.

Public Function DoesXrefExist(faPersonID As Long, faRoleCode As String, faDorpID As Long, faDorpCode As String)
If (DLookup("PersonID", "PEOPLE", "PersonID =" & faPersonID) > 0) Then
End Function

Thats as far as i have got...for the next part.I get the feeling that i need to use the recordset object that exists somewhere.How do i access that recordset object? I have not been using any DAO or ADO, just straight VBA. I know i can create recordsets and stuff using DAO/ADO, but there must be a recordset that has been created already by the Dlookup command...

View 5 Replies View Related

How To Find Record On Form Based On Multiple Queries

Jun 23, 2006

I currently have a form to manage inventory. On the left side of the form, I have a list box that shows all of the items in the database and finds the record on the form based on the selection.

I would like to have toggle boxes or something underneath the list box that when clicked will sort the box by vendor and item and another that when clicked will sort the list by part number and then select the record on the form based on the selection at that time.

I have no idea how to accomplish this...can anyone help?

View 1 Replies View Related

Combo Box To Find Record - Wrong Value!

Mar 20, 2006

Hello,

I have a form and I have added a combo box to quickly find records. I used the wizard to set this up as I did not know the code. Anyway this works, but it displays the wrong value - it displays the ID number and not the text value from the table.

The record source is a table not a query.

What am I doing wrong here, I have tried changing the control source and it doesn't work.

Any suggestions?

View 5 Replies View Related

Update Find Combo Box After Add Record

Sep 8, 2006

I have a combo box at the top of a form which is used to find records. When new records are added using the form, they do not show up in the combo box until the form has been closed and reopened.

Can anyone tell me how I can requery the combo box to ensure that it does list newly entered records?

Thanks,

Gary

View 1 Replies View Related

Find A Record Combo On A Subform

Sep 11, 2006

Hi all,

I have a form for accounts, which has a subform listing the customers within each account.

On the customers form I can use the wizard to add a combo to find a record, but if I want to add a similar combo within the subform, the option does not appear in the combo wizard.

Can anyone enlighten me on why/how to resolve?

Many thanks

Mark

(using Access 2003 on an Access 2000 format db, Win XP Pro SP1)

View 1 Replies View Related

Find Record In Main Form Based On Selection In Subform

Nov 8, 2004

Can someone tell me how I migh find a record in a main form based a a selection in my subform?

I have a Main form called frm_ProductionSchedule.

It contains three subforms:
frm_ProductionSchedule_subform
frm_ProductionSchedule2_subform
frm_ProductionSchedule3_subform


I would like to be able to select a record within any of the subforms and have the main form display it. The main form is linked to a SQL server Table. The subform are based on queries. The unique PK field is a date field called record_date.

I should add that the Link Child/Master fields are blank for all Subforms. Each Subform is linked to a query and displays data for a particular machine (1,2 or 3) AND is updated based on a combo selection of the Production week. The queries for one subform would look something like this:

SELECT dbo_tbl_ProdSchedule.PartType, dbo_tbl_ProdSchedule.PartNumber, dbo_tbl_ProdSchedule.Work_order_no, dbo_tbl_ProdSchedule.FrameType, dbo_tbl_ProdSchedule.FrameNumber, dbo_tbl_ProdSchedule.Shift, dbo_tbl_ProdSchedule.Sch1_date, dbo_tbl_ProdSchedule.Sch1_spins, dbo_tbl_ProdSchedule.Sch1_sheets, dbo_tbl_ProdSchedule.Sch2_spins, dbo_tbl_ProdSchedule.Sch2_sheets, dbo_tbl_ProdSchedule.Sch3_spins, dbo_tbl_ProdSchedule.Sch3_sheets, dbo_tbl_ProdSchedule.Sch4_spins, dbo_tbl_ProdSchedule.Sch4_sheets, dbo_tbl_ProdSchedule.Sch5_spins, dbo_tbl_ProdSchedule.Sch5_sheets, dbo_tbl_ProdSchedule.Sch6_spins, dbo_tbl_ProdSchedule.Sch6_sheets, dbo_tbl_ProdSchedule.Sch7_spins, dbo_tbl_ProdSchedule.Sch7_sheets, dbo_tbl_ProdSchedule.Frames_due_date, dbo_tbl_ProdSchedule.Comments, dbo_tbl_ProdSchedule.Record_date
FROM dbo_tbl_ProdSchedule
WHERE (((dbo_tbl_ProdSchedule.Sch1_date)=[Forms]![frm_ProductionSchedule]![cmbSchDisDate]) AND ((dbo_tbl_ProdSchedule.SpinCoaterNo)=1));

AND WHERE ((dbo_tbl_ProdSchedule.SpinCoaterNo)=2)), etc. Respectively for each subform.

Thanks in Advance!!

John

View 4 Replies View Related

Forms :: Find A Subform Record From A Separate Pop-up Form Based On Its ContractID?

Apr 24, 2014

I'm trying to find a subform record from a separate pop-up form based on its ContractID. When I click the button, I get the following error:

"A macro set to one of the current field's properties failed because of an error in a FindRecord action argument."

When I step through the code, it works just fine. Here is my code:

Code:
'Find contract
With Forms!frmContractForm.frmContractSub
.Form.ContractID.Enabled = True
.SetFocus
.Form.ContractID.SetFocus
DoCmd.FindRecord Me.ContractID
.Form.Business.SetFocus
.Form.ContractID.Enabled = False
End With

View 1 Replies View Related

Forms :: Change Record Source Of Combo Box On Form Based On Another Combo Box

Mar 31, 2014

I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.

So my questions are:

1) can this be done
2)If it can be done, how can I do it?

View 3 Replies View Related

Combo List Based On Current Record

Aug 23, 2007

I am designing a contact management system and have hit a bit of a wall. I am farily new to Access so please advise if I am going about this the totally wrong way.

I have three tables; Contacts, Companies, Company_Addresses

Contacts:
ContactID (P)
CompanyID
OfficeName

Companies:
CompanyID (P)

Company_Addresses:
CompanyID
OfficeName (P)

What I want is when adding a contact, to have a drop down list in the CompanyID field showing all the companies in the Companies table, and then in the OfficeName field, have a list of only the offices related to the company selected in the previous field.

I can do the first list, but cant work out how to list only data related to the company selected in the previous field. Any help would be greatly appreciated.

Sorry if this is in the wrong forum.

Thanks. James

View 4 Replies View Related

How To Retrieve And Display A Record Based On The Value In Combo Box

Dec 5, 2005

i have a form based on a table.The key column of the table is a combo box in the form , if i select a particular value in the combo box then i have to diaplay the all the fields in the record on the form automatically based on that particular value.

Ofcourse it is a simple task, but today only i am trying my hand in VB for the first time in my life.... so i find it difficult to find the answer.......

please help me.......

View 2 Replies View Related

Forms :: Copy Record On Form Based On Combo Box?

Mar 31, 2014

I have a form that i input information into. I have a combo box labeled Addendum, you can select "yes" or "no". What i would like to do is if user selects "yes" then a new record needs to be copied with exact information form original, with the excpetion of a field labeled "tape review #" 1403310000 for example. "-AD" needs to be added to this new record after the review number. Also the field "tape review #" is indexed not to allow duplicate numbers.

View 1 Replies View Related

General :: Display Record In A Subform Based On Combo Box Value

Oct 11, 2012

I'm creating a database for my inventory. For now, my database have two tables namely tblSupplies and tblDetails. I have a main from (frmMain) and a subform (subDetails). On the main form i have a combobox (cboSupplies) and 5 textboxes, the cboSupplies and the five textboxes are unbound. If I select a value in cboSupplies it will populate the rest of the textboxes-OK.

What I want to accomplish is that when I select a value in cboSupplies it will grab all related records from the tblDetails and populate these records on the subform (subDetails).

SuppliesID was used as the link field from mainform to subform but its not working. Please note that SuppliesID field in tblSupplies and tblDetails has a One-to-Many relationships.

View 1 Replies View Related

Navigate To A Record Based On Series Of Combo Boxes And Button

May 10, 2012

I'm trying to navigate to a record based on a series of combo boxes and a button. The user goes through the combo boxes, first picking a (let's say) Store, then Aisle, then Item. The Item combo box stores the Item's unique ID as its bound column.My code is as follows:

Code:
Private Sub NavigateButton_Click()
Me.Recordset.Clone.FindFirst "[ItemID] = " & Me![ItemComboBox]
Me.Bookmark = Me.Recordset.Clone.Bookmark '(<-- Don't actually have this in yet, but I will need it)
End Sub

The ItemID field in the ItemTable table is an Autonumber Long Integer. Why am I getting the error "Engine does not recognize 'ItemID' as a valid field name or expression"?There are no references within the form to the ItemID directly (no text boxes, hidden fields etc).

View 1 Replies View Related

Forms :: Update Record Based On Combo Box Choice And Related Tables?

Jun 3, 2014

In my database I have a table that keeps track of a package of items. The package is assigned a package type (counter display, end cap, half pallet, full pallet for example). The record of the association of the package and it's type is held in the main table.

Each of these package types is either a case or a pallet (counter display and end cap are cases and half and full pallets are pallets) This relationship is kept in another table (we will call it description table).

Now, based on the type of package and therefore it being a case or pallet a UPC and a GTIN number are assigned. The GTIN number is different if it is a case or is a pallet. I have a table that stores all of the UPC and GTIN numbers available in 3 columns, one for UPC, one for GTIN Case and one for GTIN Pallet (the UPC is a standard 12 digit and the GTINs are 14 digit -with the first 2 different to designate pallet or case. and all are based on the check digit formula necessary)

The user assigns the UPC and correct GTIN number by clicking a button which applies the next available UPC code to the package and determines if the description of the type (case or pallet) and inserts correct GTIN number into that field. I actually have all of this functioning correctly.

Now the problem. If a user changes the package type, and therefore changes the description, I need to add code to the update event of the combo box that gives the choices for package type that does the following:

Check to see if the original package type was a case or pallet (it's description) and if by changing the package type it is now changed to the other, update the record in the main table to the correct GTIN number based on the existing UPC Code.

OR as I write this, maybe the code could simply update the main table with the correct GTIN code based on the new description and the existing UPC code. This was I would not need to check for a change just do the update every time.

View 14 Replies View Related

General :: Find Record From Field In Subform And Then Return Its Parent Record

Feb 6, 2014

I have a database which has a main form and subform built in linked by parent/child customerid, what i would like to do is search all the subform records from the whole DB and return its parent record on the main form?

Can this be done? because if i use find it will only search the filtered form i have onload of the form?

My onload event is based on fosusername()

View 3 Replies View Related

Find Out Everything Is Based On A Query

Jan 19, 2005

Ms Access 2003. Is there any way to find out what is using a certain query?
I need to know if qryPFP is used by other reports or forms before changing it. I don't want to mess up anything else somewhere else. Does this make sense? We have a LOT of forms, queries and reports and it's hard to plow through everything.

View 1 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

Mar 20, 2013

I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.

View 3 Replies View Related

Change Combo Contents Based On Previous Combo Selection

Oct 20, 2005

Hi everyone,

I have two combo boxes on the same form bound to a table. I want the contents of the next combo box to change based on the previous combo selection e.g

cboContinent cboCountry
Africa Zambia
Africa Congo
Africa South africa
Europe England
Europe Holland

If I choose Africa in cboContinent, I want to see only Zambia, South Africa and Congo under cboCountry and if I choose Europe I want to see only England and Holland

Thanks
Humphrey

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

Populate Combo Box Based On Selection In Another Combo Box (Access 2010)

Jul 11, 2012

I'm have quite a difficult time getting a form in Access 2010 to perform the way I would like it to. I have multiple tables that I've created, and a query that contains the data from the various tables. I then ran the form wizard to select the data from the query that I wanted to populate in my form and I've added 2 combo boxes.

What I want to do:
1. I want users to be able to select a category in combo box #1 (example: "Bag")
2. I want users to be able to select a detail in combo box #2 based on the category they selected in combo box #1 (example: Combo box #1, "bag" would populate the following selections for combo box #2: "sandwich" and "tool")
3. I want users to then receive a list of suppliers that provide the product they have selected, either "Bag: Sandwich" or "Bag: Tool"

I have combo box #1 populating a list of categories already. However, I am not able to get combo box #2 to provide choices based on the selection chosen for combo box #1.

View 1 Replies View Related

Filtering Combo Box Based On A Value From Another Combo Box (in Multiple Items Form)

Mar 11, 2012

Let's assume we have 3 tables:

Order_Category (Order_Category_ID, Order_Type_Name) with 2 records:
1, Minor
2, Major

Order_Type (Order_Category_ID, Order_Type) with 4 records:
1, Book
1, Pencil
2, Car
2, House

Orders (Order_Category_ID, Order_Type, value) with 2 records:
1, NULL, NULL
1, NULL, NULL
2, NULL, NULL

I want to create a Multiple Items form presenting Orders table with two Combo Boxes:

1. A combo box to select Order_Category_ID.
2. A combo box to select Order_Type. When 1 (Minor) is chosen in the first combo box it should show Book and Pencil, when 2 (Major) is chosen it should show Car and House.

Examples in the Internet show how to do it on a 'single row' forms using the RowSource property. I tried to use a query like:

SELECT Order_Type
FROM Order_Type
INNER JOIN Orders ON Order_Type.Order_Category_ID = Orders.Order_Category_ID
WHERE Order_Category_ID = [comboBoxOrderCategoryID]

But it sets same values for all records in the Multiple Items form and it should return different values in each rows based on value in the first combo box (Order_Category_ID).

View 5 Replies View Related

Queries :: Dropdown Box - Find Records Based On A Form

Jul 16, 2014

I have a form with a dropdown box that shows the 'Group by' records in a table.

For example the form shows "Art_6". My table has many records (could be 1000's) that start "Art_6".

I want a macro/query to find all records that start "Art_6" and delete them.

How to find only those that start as described.

View 13 Replies View Related

Queries :: Find The Recent Available Data Based On Dates?

Jul 9, 2014

I have a price table:

Code:
tblPrice
PosNr PriceDate Company Price
1 01.01.2014 Firma A 5
2 02.01.2014 Firma A 7
3 03.01.2014 Firma A 9
4 04.01.2014 Firma A 8
5 06.01.2014 Firma A 6
6 02.01.2014 Firma XY 11
7 03.01.2014 Firma XY 9
8 04.01.2014 Firma XY 7
9 05.01.2014 Firma XY 8
10 06.01.2014 Firma XY 10

And I have a table with the dates, for which I need a price.

Code:
tblDates
PosNr PriceDate Company
1 01.01.2014 Firma A
2 02.01.2014 Firma A
3 03.01.2014 Firma A
4 04.01.2014 Firma A
5 05.01.2014 Firma A (no price available)
6 06.01.2014 Firma A
7 02.01.2014 Firma XY
8 03.01.2014 Firma XY
9 04.01.2014 Firma XY
10 05.01.2014 Firma XY
11 06.01.2014 Firma XY

And now I want to combine this tables, and for the dates which have no price, the last price should be taken.

Code:
tblResult
PosNr PriceDate Company Price
1 01.01.2014 Firma A 5
2 02.01.2014 Firma A 7
3 03.01.2014 Firma A 9
4 04.01.2014 Firma A 8
5 05.01.2014 Firma A 8 (actualy no priceavailable, so take last price)
6 06.01.2014 Firma A 6
7 02.01.2014 Firma XY 11
8 03.01.2014 Firma XY 9
9 04.01.2014 Firma XY 7
10 05.01.2014 Firma XY 8
11 06.01.2014 Firma XY 10

how I can get this?

I have this code, but it need hours.

Code:
SELECT tblDates.PosNr, tblDates.Company, tblDates.PriceDate, (SELECT TOP 1
B.Price
FROM
tblPrices As B
WHERE
B.Company = tblDates.Company
AND
B.PriceDate <= tblDates.PriceDate
ORDER BY
B.PriceDates DESC ) AS Price
FROM tblPrices RIGHT JOIN tblDates ON (tblPrices.PriceDate = tblDates.PriceDates) AND (tblPrices.Company = tblDates.Company);

View 14 Replies View Related







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