How Can I Compare Fields With 2 Bound Columns

Aug 9, 2005

Hello..

In one of my tables I have a field with the following characteristics:

Listbox
row source: SELECT Category.CategoryID, Category.Category FROM Category ORDER BY Category.CategoryID;
row source type: table/query
bound column:2
column count: 2

This gives the user the opportunity to see the category as well as the categoryID when choosing, however once selected only the CategoryID (which is a number) is visible.

I would like to put the same option on one of my forms, but Im not succeeding at this. How can I do this? Is this possible?

This leads me to my next question: If I want to load the information from the form and compare it in VBA with the one from the table, is it seen as a number or a string?
I hope it is clear..
Any thoughts on how to deal with this??
Thank u..
Stacey

View Replies


ADVERTISEMENT

Bound Columns In Forms And Resetting Values?

Jan 19, 2013

I have a form for student attendance that is bound to a query and stores a temporary value for ClassesAttended in a StudentEnrollment table as faculty enters the attendance. They then run an append query to write the temporary records to a StudentAttendance table. Because the ClassesAttended field is bound, when the form is opened, it recalls the last number entered for that student in that class as entered by the faculty the last time attendance was updated. I tried leaving the field unbound, but the first value enter into the first record of the form is updated automatically to all subsequent records.

Is there a way to change the properities, use code, etc. to assigne a null or 0 to the ClassesAttended field when the form opens, without the first updated record to propagate through the reaming records?

View 3 Replies View Related

Compare Values Of Columns Within The Same Query Table

Nov 19, 2006

Hi,
I am trying to compare two columns' values within the same QUERY table, but I kept on getting the "Data type mismatch in criteria expression" error. What am I doing wrong?

Here is my Select Query Statement:
SELECT qryDedparmDedetail.EMP_ID, qryDedparmDedetail.[Employer Amt], qryDedparmDedetail.[Employer Actl], qryDedparmDedetail.[Admin Amt], qryDedparmDedetail.[Admin Actl], qryDedparmDedetail.[Employee Actl], qryDedparmDedetail.[Employee Amt], qryDedparmDedetail.FirstOfSTATUS, qryDedparmDedetail.FirstOfAGENCY, qryDedparmDedetail.FirstOfTITLE, qryDedparmDedetail.FirstOfFORMAT_NM, qryDedparmDedetail.RepUnit, qryDedparmDedetail.FirstOfDEDTYPE_CD1 AS Expr1, qryDedparmDedetail.SumOfNBR, RepUnit.REPUNITDESC, qryDedparmDedetail.LeftType
FROM qryDedparmDedetail LEFT JOIN RepUnit ON qryDedparmDedetail.RepUnit = RepUnit.REPUNIT
WHERE (((qryDedparmDedetail.[Employer Amt])<>"Employer Actl") AND ((qryDedparmDedetail.LeftType)="01"));

View 2 Replies View Related

Modules & VBA :: Compare Values Of Several Columns Of A Record

Jan 23, 2014

I would like to compare the values of several columns in the same record and remove any duplicates. So...

ID | Col1 | Col2 | Col3 | Col4 | Col5
-------------------------------------------
1 | A | B | C | D | C
2 | C | C | C | D | D
3 | A | A | B | A | D

In the above example I would remove one of the Cs in row 1.

Two Cs and one D in row 2 and two As in row 3.

At the moment I have the value of each column stored in a variable and each one is compared against each other using LOTS of If statements.

View 5 Replies View Related

Calculating Bound Fields

Oct 3, 2006

I have a table for invoices that need to show Nett, VAT & Total. I have set up a form and have included a calculation on both VAT (Nett*17.5/100) and Total (Nett+VAT) which works well in the form. Because these calculations are in the ControlSource, I do not know how to have these fields bound to the original table.

Am I missing something really obvious???

View 1 Replies View Related

Compare Memo Fields

Feb 5, 2008

Can someone tell me if this can be done somehow.

I have a date field, ID field and a memo field (I have to have this memo field).
I want to compare the memo fields by two certain dates and find out what doesn't match and if the ID field is blank. I have been trying with quaries but no luck.

I am not sure what forum this would fall under so I put it in general. feel free to move.

View 7 Replies View Related

Compare 2 Fields To Get 3rd Field...

Apr 13, 2006

Hello,

I have 2 tables:

tblProviders
ProviderName
ProviderAddress
ProviderType
LocationCode
FacilityType
Etc...


tblFacilityType
ProviderType
Location
FacilityType

In tblFacilityType, the FacilityType field is a combonation of ProviderType and Location. Each of those fields are alphanumeric. What I want to do is have the FacilityType field in the the tblProviders table to look at the Location and the ProviderType fields in the tblFacilityType table to determine what the FacilityType field in the tblProviders table should be.

Hope that is understandable.

Thanks in advance for any assistance.

View 5 Replies View Related

Queries :: Need To Compare 2 Fields

Jun 13, 2014

Need to compare 2 fields in a query, and return the larger of the 2 values in a 3rd field.

As in:

Field A=10 Field B=6 I need Field C to = 10.
Field A=5 Field B=6 I need Field C to = 6.

View 3 Replies View Related

Adding New Fields To Table Bound To A Form

Jan 31, 2005

I have a form which I've spend many hours designing to look and behave as I need it. It is bound to a table (get's it's data from there). I now want to add one or more new fields to the table (which I've done ok), but I can't seem to get the Form to see those fields. I've tried creating new controls on the form and the control source list to select from doesn't include my new fields.
Even if I write VB code embedded in the form to refer to the fields, the debugger trips on the field names saying no such method/object. The only way around it I've discovered is to create a new bound form which will mean re-dooing al the layout work again.

Surely this is a common situation which has an easy solution ?!!

View 4 Replies View Related

Modules & VBA :: Copy Between Unbound And Bound Fields

Apr 21, 2015

I have 2 fields in an MS Access form "BTKForm" sending and picking up data form a bank terminal.

Code is executed by clicking a Button on the form.

Field 1, "IssuerID", is an Unbound field picking up a code from the bank terminal. It's numbers between 0 and 100, representing the Card provider.

Field 2 - "IsID", is a value field linked to a table.

I want to take care of (save) (copy) "IssuerID" in to "IsID".

Code:

Public Sub TransferAmount_Click()
Set BAX = CreateObject("BankAxeptSrv.BankAxeptAutomation")
If BAX.Connected And BAX.LicenseVerified And Not BAX.BankMode Then
Dim amnt As Long
Dim cashb As Long
amnt = Round(Amount.Value * 100)

[Code] .....

View 12 Replies View Related

Compare 2 Values From Fields On A Table

Mar 6, 2006

Hi there

This is probably quite easy but I cannot make it work so would appreciate some help. I have a table containing vehicle information. I have 2 fields, Current Mileage and Max Mileage. I want to do a comparison of the 2 fields and should the Current Mileage be greater than the Max Mileage, the query returns the Vehicle Registration. Test data has been entered in the table I am querying and I was expecting 1 value to be returned. However the query as I wrote returned either all the vehicle Registrations or none of them. Can someone help with this please.

Thanks in advance for the assistance
Craig:)

View 2 Replies View Related

Easy Question - Compare 2 Fields

Mar 12, 2006

I have a field called Badge_Number in Table A.

I have a field called Badge_Number in Table B.

In Table A Badge_Number has entries 101, 102, 103, 104, 105

In Table B Badge_Number has entries 102, 103

How can I do a query to get a list of entries that are in A but that are not in B. (Query result would be 101, 104, 105)

This is the only thing I have to do in Access, so after trying to learn this for a while, I have decided it would be much easier to get help at this time.

View 2 Replies View Related

Update Several Fields And Compare Strings

Aug 8, 2007

Have devloped a database to log all support issues for an application I work with.

I periodically update the database by importing from another database

for example my main table tbl_issues has fields IR_NO, DESCRIPTION and STATUS

I then import data from tbl_import which also has these fields. The following query works fine:

UPDATE tbl_support
SET tbl_support.STATUS = tbl_import.STATUS
WHERE tbl_support.STATUS <> tbl_import.STATUS
AND tbl_support.IR_NO = tbl_import.IR_NO

However I also want to do this at the same time:

UPDATE tbl_support
SET tbl_support.DESCRIPTION = tbl_import.DESCRIPTION
WHERE tbl_support.DESCRIPTION <> tbl_import.DESCRIPTION
AND tbl_support.IR_NO = tbl_import.IR_NO

How do I update both fields at the same time?

View 2 Replies View Related

Forms :: Compare 2 Text Fields?

Aug 27, 2013

Text fields name:

Password
confirmpassword

Trying to achieve:

on "After update" event for Confirm password a code needs to find if both Passoword and confirmpassword are having the exact character (Case sensitive).

Below code doesn't recognize the Case. It allows as long as both words are same:

Dim StrString1, strString2 As String
StrString1 = Password
srtString2 = ConfirmPassword

[Code].....

View 8 Replies View Related

Forms :: Compare Dates In Two Fields?

Jun 18, 2014

I would like to change the colour of field on a form if the date in that field is later than the date in another field.

View 9 Replies View Related

Queries :: Compare Fields In Different Records For Changes

Jul 18, 2013

I have a table called tblAuthorizations. It appears as follows

AuthInstanceID....ConsumerID....AuthNumberID....Au thStart....AuthEnd....PSRUnits....BSTUnits
1374006036.........356679..........20255102....... ...4/22/13......7/21/13.....0..............416
-432536491.........356679...........20255102....... ...1/21/13.......4/21/13....104..........416
-124970517.........356679...........20147863....... ...10/23/12.....1/20/13....208..........520
504564357...........469432..........20254788...... ....4/22/13......7/21/13....0..............520
282523535...........469432..........20254788...... ....1/21/13.......4/21/13....0.............520

I work in mental health, and when we put in a request for a consumer to receive PSR & BST services, we put the above information into our database. Each record identifies which consumer the authorization is for, a start date and end date for them to receive services, and the amount of two types of services (PSR and BST). When one period ends, we request another period, such as in the first three records above, and then the final 2 for another consumer.

What I need to be able to tell is how their service authorizations change. For instance, if I were to compare the first and second records, it would tell me that PSRunits decreased 4/22/13-7/21/13 from 1/21/13-4/21/13 levels.

I have a query that displays the records for each consumer for the current period, but I can't figure out how to identify the previous period's number of PSRUnits or BSTUnits.I've tried adding the following fields, but this isn't working.

PrevEnd: (Select Max(AuthEnd) from tblAuthorizations Where AuthEnd < Auths.[AuthStart])
PrevBST: DLookUp("[BSTUnits]","tblAuthorizations","AuthEnd=" & [PrevEnd] And "ConsumerID=" & [ConsumerID])

View 2 Replies View Related

Forms :: Text Prompt In Fields When Bound To A Numeric Field

Sep 12, 2014

I have several combo box fields in a bound form where they are selecting values from a list (values stored in a separate table) and then loading a number into the bound table field when selected.

How can I put a text prompt in these fields when loading the form which gets removed when focused and of course is not permitted to attempt a save into the bound numeric fields? I've done quite a bit of searching but can only find materials about doing this on bound text fields. I've also seen solutions using Nz which don't seem to work.

View 4 Replies View Related

Queries :: Populate Form Fields With Records From A Table Bound To Recordsource

Feb 5, 2014

I would like to populate form fields with records from a table/query so that they are bound to the recordsource and the record to be displayed can be selected from a combobox. I am hoping that in this way, any changes made are propagated to the original table.

I have created a combobox from which the primary key can be selected and added all the fields from the table appearing on this form as values.

In my Change event for the combobox I have this code:

Private Sub cboID_Change()
Me.RecordSource = "SELECT b01_Participants.*FROM b01_Participants WHERE (((b01_Participants.ParticipantID)= " & cboID.Column(1) & "));"
Me.Refresh
End Sub

However, I receive an 3075 error when this code runs which seems to relate to my syntax or an extra ")".

View 14 Replies View Related

Forms :: Count Of Records Between Value Of Two Fields - Enter Total In Bound Field

Aug 8, 2013

I have two fields on the main form and I need a total count of records between the value of the two and then enter the total in a bound field on the main form

View 1 Replies View Related

Queries :: Compare Data In 3 Fields In 1 Table / Group By Largest

Dec 4, 2013

I'm trying to create a query that will compare the data in 3 fields in a record, choose the largest (I also have a criteria to order by if more than 1 field has the same entry and it's the largest of the 3), and then group by that.The fields I will need are as follows:

PRODUCT table:
ProductName
Chemical
ChemicalAbstract
PhysicalState
NFPAHealth
NFPAFlammability
NFPAReactivity

qryQuantityOnHand query (which doesn't link directly to the PRODUCT table, it links through associations with other tables):QOH...I will eventually need information from another table for the final reports, but I don't think it has to be included in this query.

The fields NFPAHealth, NFPAFlammability, and NFPAReactivity each may be 0, 1, 2, 3, or 4...I need to ignore blanks; if 1 of the above fields is blank, they will all be blank.For any record, I need to compare the number in those 3 fields to each other, and choose the largest number and group by that rating.

In other words, if the largest of the 3 numbers is a 3 in the NFPAFlammability field, all those products need to be grouped together.If the same number appears in at least 2 of the fields, the order that determines the grouping is: Flammability, then Health, then Reactivity..Ultimately the report will be grouped as follows:

Flammability
Rating 4
Product 1
Product 2
Product 3

Rating 3
Product 1
Product 2
Product 3

Rating 2
Product 1
Product 2
Product 3

Health
Rating 4
Product 1
Product 2
Product 3

[code]....

and each of the groups will be sub-totalled.I'm stumped at trying to create the query in the first place.The added aggravation here is that we are dealing with 23 stores, each with their own mix of products. I have another table that contains the information about which products are in which store.

View 4 Replies View Related

Bind Columns (Fields)

Aug 2, 2005

I have been looking on the forum for some code that would bind all columns (fields) starting from column 15 to 26 to a combo box



for example....



Field 1 Field 2 Field 3 Field 4

data1 data2 data3 nodata



Combobox

data 1

data 2

data 3





kind of like a grid

based on the record I select in my form the combo box will show the columns that have data for that record.



It is trycky but I have no idea how to get that started





Thank you all for your help

View 4 Replies View Related

Counting 2 Columns/fields

Jul 17, 2006

I have been pulling my hair out over a query application and I'm looking for some help...

For instance, I have a table with [PrimaryName], [SecondaryName] and [JobDate]. I want a query that will display if there is more than one occurrence of the same name in either name field on the same date.

If it were just one field I could do this using GROUP BY and HAVING but because I need to check both name fields I'm stumped. I tried a union query but that seems to group multiple occurrences together as one entry.

Any help is appreciated.

View 4 Replies View Related

Max Columns/Fields In A Query

Nov 28, 2007

Could anyone tell me if there's a hardcoded maximum number of fields/columns in a query?

I ask, because through some experimentation and the urging of others on the boards, I've finally taken a look at the SQL view of a database and found it rather easy to understand. There, I found I had more flexibility filtering a Query via SQL in comparison to the query design window. (unlimited "Or" vs. 8).

So, even though there's a definite number of columns in the Query Design window, can I ignore than and just enter what I need in the SQL view?

View 6 Replies View Related

Report - Columns Within Fields?

Nov 21, 2006

I'm new to access, so any help is greatly apprciated. Is there a way to have one field within a report show up as 2 columns? Thanks much!

View 2 Replies View Related

Automatically Populating Fields/columns

Dec 21, 2005

I have Two tables one table has a Master list of products (ProductMaster) with a Unique product code (ProductMaster.UQ_ID).
The second Table has Order data. The Second table (OrderTable) is where I will enter the product code (UQ_ID) which is the unique Identifier which is also in the ProductMaster. As soon as I enter the Prodt code in the OrderTable I should have all the related fields filled in from the Product Master.

Columns in The ProductMaster = Product_ID, Product_Manucaturer, Product_Weight, Product_Color, Product_Size

Columns in The OrderTable = Product_ID, Product_Manucaturer, Product_Weight, Product_Color, Product_Size, Order_Date, Ordered_By

The columns marked in red are the ones that will have to be automatically fetched from ProductMaster

The data in the second table should be populated from the ProductMaster as soon as I enter the Product_Code. The rest of the details Can be filled manually filled in.

Is it possible to do this with Access. I have tried different expressions in the Fields without much use. The Documentation from Microsoft is very weak. If someone knows a solution or where the documentation is, please help.

Thanks

View 2 Replies View Related

Remove Duplicates From Four Different Fields/columns

Jul 31, 2007

Hi everyone,

I am working on a database to manage newsletter subscriptions. Each subscriber record has the option of having up to four email addresses registered to his/her name.

Is there a way to check for duplicate email addresses in the entire database? It would have to compare all values in all four fields of all records.

Any ideas on how to implement such a thing? I'm clueless...

Thanks!

View 2 Replies View Related







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