Table And Its Query Reflect Combo Box ID Equivalent Not Text Result

Mar 10, 2014

Whats the best way to show the text result of a combo box selection when displaying the information through a query? I notice the table is also reflecting only the numerical ID result of the selection so I'm not sure how to take this result and display it as a text result to the user.

View Replies


ADVERTISEMENT

I Need A Query To Reflect A Value Based On Combo Box Selections

Apr 11, 2006

Hi all,

In my database, different Customers have different Rates.

I am trying to run a query that will pull a value dependent upon The Service Type & Customer that have been selected from combo boxes.

My database tables are as follows;

(Rate Profile Table)
RateID
ON8
ON11
SD

(Customer Profile Table)
CustomerID
CustomerName
CustAddress
RateID

(Shipments Table)
ShipmentID
WaybillNo
Date
ServiceTypeID

The ServiceTypeID is selected on the Shipments Form by making a selection from a combo box that has been populated by the RateID Table Field Names (which are the service types).

Everything works fine but I need to be able to run a query to calculate the freight charge (from the appropriate rate in the Rate Profile Table) according to which Customer & Service Type has been selected, but not having much joy.

I would be extremely grateful if someone could point me in the right condition.

Thx...

View 8 Replies View Related

Combo Box To Reflect Current Record

Jan 2, 2007

Hello All

I can't get my combo box to do what I want. I think I need a line of code - (but I don't know how to write code !!)

I have two combo boxes on my form. The first one is used to enter a Client name (ClientID). I want to use the second combo box to enter a ClientPartner(PartnerID). But I want the drop down choice of ClientPartner to be restricted only to the ClientPartners at the Client selected in the first box.

They are related in tables (one ClientID can have many PartnerIDs).

My query tests OK, when I manually enter a ClientID. It doesn't work when I attach it to the combo box. I can see why - I need something that says "take the ClientID of the record on the CURRENT form". In the absence of this, its always taking the first ClientID in the database.

Here is the code behind the second ComboBox.

SELECT t_ClientPartners.PartnerID, t_ClientPartners.Name, t_ClientPartners.ClientID
FROM t_ClientPartners
WHERE (((t_ClientPartners.ClientID)=[Forms]![f_Deals]![ClientID]))
ORDER BY t_ClientPartners.Name;

How do I make it do what I want? Is this something to do with Set Focus?

NoVoice

View 2 Replies View Related

How I Can Take Text And No Number In Result That Arises From A Combo-box Into A Searc

Jun 11, 2007

How I can take text and no number in result that arises from a combo-box into a search form?

View 5 Replies View Related

Combo Box Performs Query, Update Combo Box With Only Result?

Aug 4, 2006

Here's the deal:

I'm an extreme newbie, I do not know access very well, nor do I know VBA, I do know PHP.

I have a for in access that has 2 user input fields, one for prodid one for shipid. I have a combo box that upon entering data into the previous 2 fields, it does a query against an MsSQL database looking for a record that has both. In any case there will only be 2 outcomes, either 1 record, or null. I would like to have that same combo box automatically use the result as it's value so that users don't have to check the box, because they won't, and so that the rest of my VBA will be able to function properly.

Can anyone assist?

Thanks.

View 2 Replies View Related

Query Result To Text Box

Jan 5, 2006

Hi
I have a query with 2 fields, when it is run it returns a result based upon the result of the set criteria.

Can you get this value to be displayed in a text box after a button is pressed.

dave

View 3 Replies View Related

Text Box Show Result Of Query?

Aug 6, 2014

I have a form with combo boxes, each combo box further limits the criteria of a query as selections are made. I have a Me.Requery code for each combo box. - This is working great.

Once all of the selections are complete, I need the result of that query to show in a text box. - There will always be only one result.

View 2 Replies View Related

Forms :: How To Save Result Of DLookup Function (used In Unbound Text Box) In A Table

Oct 17, 2014

I have a form based on query. On form i am retrieving data from another table using DLookup in a unbound text box. So I want to save the result of DLookup function in another field/table on same form.

View 8 Replies View Related

Populate Text Boxes From A Query Result

Feb 17, 2006

hi,
I hope someone can help me here..

I have a form with ID, town and address on it.
I want to beable to type in an ID, press enter then if the ID exists in a query then populate the town and address text boxes with the correct info..

If the ID doesn't exist, then open another form so the user can choose the site from the list..

At the moment I think I am going about it the wrong way :


Private Sub ID_AfterUpdate()

intResult = DCount("*", "Q_findsite", "")

If intResult = 0 Then

Dim stDocName As String

stDocName = "Sites_listbox"
DoCmd.OpenForm stDocName, ,

End If

If intResult = 1 Then

Dim rst


--THIS PART FAILS WITH A RUNTIME 3061.. ?
Set rst = CurrentDb.openrecordset("Select town,address FROM Q_findsite ")

[Forms]![AddFault]![Town] = rst.Fields(0)

[Forms]![AddFault]![Address] = rst.Fields(1)
End If

End Sub

the Q_findsite query is expecting a parameter for ID = [forms]![addfault]![ID]


Is there an easier way of doing this ?
thanking you in advance.

View 6 Replies View Related

Combo Box Query To Post Result To A Seperate Query

Sep 27, 2006

Hello, I have a combo box on a form which lists some names generated from a table.

I would like the selected name to be inputted into the 'critera' of another query called 'qryPBCustLevel' and for that query to be run.

I have tried to code this, but it is crashing at the point it trys to add the name into the query.

Can anyone help? Code listed below.

Sub cmbPB_AfterUpdate()

'Set the Dimensions of the Module
Dim strSQL As String, strOrder As String
Dim dbNm As Database
Dim qryDef As QueryDef
Set dbNm = CurrentDb()

'Constant Select statement for the Query definition

strSQL = "SELECT DISTINCT tblTempPB.PB_NAME" & _
"FROM tblTempPB"

strOrder = "tblTempPB.PB_NAME;"

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

'Pass the QueryDef to the query
Set qryDef = dbNm.QueryDefs("qryPBCustLevel")
qryDef.SQL = strSQL & " " & strOrder

'Open the Query
DoCmd.OpenQuery "qryPBCustLevel", acViewNormal

End Sub

Thanks, Steve. :confused:

View 2 Replies View Related

Modules & VBA :: How To Show Query Result In Text Boxes

Jun 25, 2013

I have query that creates table with 2 records each with 2 columns (2x2) and they do not have indexed ID,and query is related to combo box in other form so results are not always same but it is always (2x2) and value types are always same,

So how to show those results in text box in form,lets say 4 text boxes ,every value in one text box, i assume that i need to use DLookup() but i was able only to show first record,did not know what criteria put to go to second record.

When i select that query and create report i get what i want but i cant copy those text boxes to form that i want.

View 10 Replies View Related

Forms :: Result From A Query Being Passed To Text Box On Form

May 6, 2014

I am making a database for my work place where there is telephone counsellors and they need to complete a certain number of supervision hours and a few other categories of hours required for training and several other things. The manager wants to be able to see the total supervision hours and the other categories for a worker when the worker is selected and the date range for the queried time entered.

I have a form that has quite a few items on it. I have two text boxes that allow me to enter a start date and an end date, I have a combo box that allows me to select a worker and I have 3 text boxes that I want to populate with the sum of 3 separate columns in another table when the date is entered and the worker selected so the manager can see, at a glance, how many hours each worker has done on the separate items. Maybe I would need an update button at the bottom that, when clicked, would perform the required calculations.

I have 3 queries that return the required information but I need to get one of the columns from the query results put into each of the 3 text boxes. Basically, when I click on the buttons the right query appears, I just want column 3 (which is a sum column) to get put in the corresponding text box and I want all the boxes to display the sum of their corresponding queries when a date and person is selected.The form is called frmSearch, the 3 queries are called qry_sumisshours, qry_sumisshours and qry_sumtcshours. The 3 text boxes I need to get populated from the queries are called txt_ results_ sv_ hours, txt_results_TCS_hours and txt_results_iss_hours.

View 10 Replies View Related

Write A Concatenate Query And Display Result In A Text Box On A Form

Jul 20, 2005

Here's the form I'm trying to Create:

VEH POS NAME
A21: TC: CPT Somebody
G: SGT Someoneelse
D: PVT Noone

A22: TC: SFC Smith
G: SGT Jones
D: PVT Doe

and so on and so forth.

The VEH and POS are just going to be Labels in a form....no prob. Each Soldier's Squad and Team (for mounted Vehicle and Position) are stored in the Personnel Table. The below query is for vehicle A7 (ACTUAL would be the same as TC above). The query works. I just need to know how to get the result to display in a text box. What I'm planning on doing is creating text boxes for each posistion with these small select queries, so when I update the SQD and Team in the Personnel Table it updates on this form. Or is there an easier way to do this?

Dim strSQL as string
strSQL="SELECT [tblPERSONNEL]![RANK] & " " & [tblPERSONNEL]![LAST_NAME] AS NAME
FROM tblPERSONNEL
WHERE (((tblPERSONNEL.SQD)="A7") AND ((tblPERSONNEL.TEAM)="ACTUAL"))"

View 3 Replies View Related

Forms :: Get A Certain Column Of Query Result Pasted To A Text Box When Open Form?

May 7, 2014

How do I get a certain column of a query result pasted to a text box when I open the form?

View 2 Replies View Related

Forms :: Attempting To Have Single Query Result Display In Text Box On Form

Jul 3, 2014

I have the need to display the return of my "Sum Query" to display in a text box.

I need the attached below value (40500) in the "SumofQuery" attachment, which updates every 5 minutes to display on the "StatusBoard" attachment text box.

I have been searching for a good 10 hours on how to do this and still cannot find it.

View 14 Replies View Related

Split Table In 4 Equivalent Parts By 3 Criteria?

Dec 19, 2014

I have a table with the folowing structure:

ID(integer)
Value1(Double)
Value2(Double)

I need to split this table in 4 equals parts:

- count of id must be equal or close to equal(ex: 467 split in 3 x 117 and 116) for each part

- the cumulated Value1 and Value2 must be equal or close to equal for each part

View 3 Replies View Related

Queries :: Split Table In 4 Equivalent Parts By 3 Criteria

Dec 19, 2014

I have a table with the folowing structure:

ID(integer)Value1(Double)Value2(Double)

I need to split this table in 4 equals parts:
- count of id must be equal or close to equal(ex: 467 split in 3 x 117 and 116) for each part
- the cumulated Value1 and Value2 must be equal or close to equal for each part

View 11 Replies View Related

If A Make-table Query Result Is Null, How To Have A Default Message Appear In Table ?

Jan 21, 2005

Hi everybody,

Beginner here needs help !

I'm building a make-table query for which if the result is null (no record correspond to the set of criterias), a default message like "there was no activity during the period" would appear in the table (not a message box...I need the message in the output table). The best I could think of is an IIF function but it doesn't seem to work... Is there any way to do this without using VBA?

Thanks in advance !

View 1 Replies View Related

Queries :: Equivalent Sql Procedure In Access Query

Dec 6, 2013

i'm using a sql procedure which i'd like to implement the equivalent in ms access. i want to know if they can be any possibilities. this is my procedure

Code:
CREATE PROCEDURE CreateOrders
(@cartId char(36))
As
DECLARE @CmdID int
INSERT INTO Commande DEFAULT VALUES
SET @CmdID = @@IDENTITY
INSERT INTO DetailsCommande ( CmdID, ProduitID, ProduitTitre, Quantite, CoutUnitaire )

[code]...

View 11 Replies View Related

Convert Date To Its Numerical Equivalent In A Query?

Sep 23, 2014

How can I convert a date format to it's numerical equivalent inside of a query? For instance, 1/1/2014 to be 41640.

View 2 Replies View Related

Queries :: Conditional Query To Post Result In Field And Filter Result Records?

Mar 5, 2014

I am working with Access 2010, on vista. What I have is a query made up of two tables, one product the other inventory. (see below) query.jpg

In the product table i have a field called "minimum reorder level". In the inventory table i have two fields one called "number in stock" and "number on order". What i want to happen is "number on order" to be filtered by the result, if the "number in stock", is less than "minimum reorder level", if it is, have the result placed in the "number on order" field. EG. if the "number in stock" = 2 and the "minimum reorder level" = 5 then 3 would be placed in the field "number on order" and only the second record from the query would be visible (see below) Query result.jpg The result of this would mean that the field "number on order" would be populated with the result and the and query would also use this to filter the record.

View 1 Replies View Related

General :: Adding Count To Result Of Query Depending On Month And Result

Aug 18, 2013

I want to add a number to my results within a query depending on the month and how many results. For example I have 10 results in my query 3 from January, 5 from March and the rest from April. The 3 from January would be 1,2,3. The five in March would be 1,2,3,4,5 and so on. Is it possible to do?

I'm using access 2003.

View 4 Replies View Related

Query Result Changes When Table Removed

Jan 26, 2006

Hi,

New to this forum so be gentle! I'm also recently self taught on Access 2003 and developed a fairly substantial database for my company to track projects. My terminology may be off but hopefully youcan follow.

I have a number of queries created by copying existing queries and tweaking them. I was attempting to fine tune one of these by removing tables that had no bearing on the query. I was surprised to find that the number of records returned changed when I did this. I tried this with a number of queries and it seems to be common, on my database at least.

The tables removed had no fields selected for the query and had reltionships to only 1 of the remaining tables so it shouldn't have made any difference? In ever instance, the returned record set was a smaller nukber than before the unused table was removed.

Any ideas.

View 1 Replies View Related

How To Save Query Result To Table

Dec 6, 2004

I want to save an Access query result to a Table, but I couldn't find a way. The only thing I can do is save the result to excel or as a query in another file. Any hints? Thank you very much.

View 2 Replies View Related

Filling A Table Field With A Query Result

Nov 23, 2004

I have a query_ReimburseResult
that counts the yes/no answers in field Reimburse from tbl_Survey.

How do I take the results from the query and put it into a field in another table?

I have tbl_Result and a field called ReimburseResult. I set the type to long integer and then what?

thanks!

View 2 Replies View Related

Display ADO Query Result In A Table Form

May 1, 2008

I would like to allow users create a query and then display the result in a new table. Just like the regular way in Access.

I know how to do it using DAO. However, I am working on a ADP, and want to use ADO for this. I cannot find a solution in ADO. So frustrated!

Any help is appreciated!

View 5 Replies View Related







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