Forms :: DLookup - Unbound Field To Auto Determine Pricing Based On 3 Criteria Chosen

May 28, 2014

I have a table that consist of pricing for different types of products:

Table name: Costs

ID TYPE EastNew EastRenew WestNew WestRenew
1 500 4100 1000 4400 900
2 501 4100 1000 4400 900
3 600 3400 900 4600 1200
4 700 3700 1300 4900 3300

I have a form that consist of many fields that the user needs to manually input data. 3 fields on that form are the criteria i need to determine which pricing to use back on the table. The first field, which name is LTYPE, is a combobox that the user needs to choose as its type (i.e 500,501,600,700). The second field, which name is EastCoast, is a checkbox (Yes/No) that tells me if it's East Coast (East = yes and West = No). The third field, which name is NewRenewal, is a combobox that the user chooses NEW or Renewal).

Example 1, if the user chooses type 501, checkbox is YES for East, Product is NEW. Then the pricing is $4,100

Example 2, if the user chooses type 700, checkbox is unchecked for NO (which is West), Product is Renewal. Then pricing is $3,300

I would like the unbound field to auto determine the pricing based on the 3 criterias chosen. I read around the forums that Dlookup would be the function for this, however, i tried many times but it did not work.

View Replies


ADVERTISEMENT

Reports :: Filtering A Report Based On Chosen Criteria In The Form

Mar 12, 2015

I have a report with a table as the row source. I have command buttons that opens different forms and allows the user to choose criteria, the form then filters the report based on the chosen criteria in the form, but if I use the destination city form to filter the report by destination city, then filter the report using a different form, the destination city filter is lost, is there a way to filter the report with a form by say destination city, then further filter that dataset with another form for say location city.

View 14 Replies View Related

Forms :: Multiple Between / And Criteria But Only One To Be Chosen

Oct 20, 2014

I have a form where users can enter the beginning and ending dates into text boxes. They could also do it for the number of the week (1 to 52) or a single text box for the quarter.

I set up VBA code where, if you click on a button, it will clear out the data from the other two options before a query is run based on the parameters in those text boxes. Here's a sample piece of code.

Code:
Private Sub btn_UseDates_Click()
Dim lngGreen As Long, lngWhite As Long

lngGreen = RGB(0, 255, 0)
lngWhite = RGB(255, 255, 255)
Me!txtDateFrom.BackColor = lngGreen
Me!txtDateTo.BackColor = lngGreen
Me!txtWeekFrom.BackColor = lngWhite
Me!txtWeekTo.BackColor = lngWhite
Me!txtQuarter.BackColor = lngWhite
Me!txtWeekFrom = ""
Me!txtWeekTo = ""
Me!txtQuarter = ""
End Sub

I've tried setting those txt boxes to Null and I've tried both "" and " ", but to no avail. The query will work if the three types of ranges (date, week, or quarter) are on OR lines, but not on the same line.

View 5 Replies View Related

How To Make Unbound Field Auto-populate Conditionally From Another Unbound Field

Jan 30, 2015

To make it simple, I have a list of contact names and their email. I want to have a form with no control source and have 2 simple drop down boxes for their Name and their Email. What I would like to happen is the user choose a name from the drop down in field 1 and then the field below auto-populate their email in field 2. I understand I can use conditional IF/THEN and list out each email, but the contact list is ever changing, so I want to first drop down to link to the TblContacts, have the user pick the name from the list and then have the 2nd field autopopulate from that same TblContacts with their email respective to the Name entered in field 1. My form has two field [Traveler] and [Email]...The tblContacts two fields are [Name] and [Email]

Code:
DLookup("[Email]", "tblContact", "[Name] = [frmEmail]![Traveler]")

View 5 Replies View Related

Forms :: Unbound Field Value Based On Another Field

Nov 17, 2014

I have a continuous subform that draws information from a table (Calls). This subform shows a variety of fields among them one called "ResolutionDetails".

This field can have various values such as "In process, Completed" Initial contacts", Repairing,..."

I have been asked to simplify this subform by hiding this field and adding another one (not to the table, just to the continuous form) that shows only two possible values: "In Process" or "Completed"

So let's say I create a new unbound field in this continuous form; How can I do so this field checks the value of "ResolutionDetails" and it shows one of the two options? My guess is that I need to give this new field a default value of "In process" and have it change to "Completed" when "ResolutionDetails" value is "Completed"

View 2 Replies View Related

Forms :: DLookup For Unbound CheckBox

Jun 29, 2014

On my Login form I am trying to get the status of a user. Form and checkbox are unbound.

tblUserSecurity_Sec
userID is the UserName.
Field (Active) Data Type is Number, Field Size is Integer

CheckBox is (chkactive)

If DLookup("[Active]", "tblUserSecurity_Sec") = -1 And [userID] = (Me.txtUserID) Then
Me.chkactive = -1
End If

View 11 Replies View Related

General :: Determine Value Of Any Field Based On True And False Statement

Aug 5, 2013

In a form, the value of any field may determine if the other field will be true or false. For example in my form, inventory, if value in code is equal to 2 then the Field Table will be automatically false.

View 12 Replies View Related

Reports :: DLookup Criteria - Autofill Product Name Based On ID

Apr 2, 2013

Im trying to make an invoice,

Im trying to autofill the products name using a dlookup

The ProductID1(2,3,4 OR 5) is selected from a list in a form and is sourced from "Products!ProductID"

=DLookUp ("Products!PName","Products", where "ProductID1" = "Products!ProductID")

How do i make this work,

Without the "critera" the lookup returns only the 1st record of "Products!PName" for every transaction even though the ProductID1 differs

How to i get it to show the correct corresponding name to ProductID1??

Ive attached a screenshot....

View 3 Replies View Related

Forms :: Auto Populate Field Based On Combination In Different Table

Oct 17, 2014

I have two forms - Main and StudentAdvisor (filtered by student ID#) SAdvisor.jpg

The main form originally had a combo box field to display advisor, the problem is that some students had multiple advisors during the course of their program. This problem was fixed by the creation of a StudentAdvisor (table/form) for recording ALL advisors. I set the form to display by newest term so the current advisor (or initial if no change) is the displayed record.

On the main form I then added "add" to open the StudentAdvisor form for entering information, and an unbound txtfield to display their current advisor (or initial advisor if no change).

The problem is I can not get the txtfield to display the information. I have managed to get the error ( #Name?)

Advisor Type 1=Initial, 2=Current, 3=Previous
Changed 1=Yes, 2=N/A

so a record would record as:
Initial and N/A
Current and Yes
Previous and Yes

I tried writing DLookup but could not get that to look up the combinations (above) and display either initial or current.

also tried pulling form SA = Advisor to form Main = txtAdvisor

For report purposes I need to know not only current advisor but how many were assigned during the program and also how many students each advisor was assigned during certain time frames.

View 1 Replies View Related

Tables :: Can Set Auto-number Counter On Computer To A Chosen Value

Jan 29, 2015

I am having is that the auto-number value on his machine is different than on mine so anytime I try to add data in testing, it tries to create a primary key value that already exists in the table.Can I set the auto-number "counter" on my computer to a chosen value so I don't have these issues?

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

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

DLookup To Determine If Query Returns Any Records

Mar 5, 2012

I have a query that runs just fine and takes about 1 minute to run on average. I have vba code that uses Dlookup to determine if the query returns any records. The problem is that each time it runs it has to crunch all the data, all I care about is if there is any result at all. Is there a way to get the query to stop after it finds one record to speed things up greatly?

View 2 Replies View Related

Populating Page Based On Item Chosen

Jun 20, 2014

What i am try to do is have specific text boxes or items appear on the form depending on the combobox item you have chosen.

For Example

Combobox

CAR
CAKE RECEIPE
CLOTHING

if car is chosen 2 text boxes appear example car manufacturer, Car name. If Cake recipe is chosen a larger text box appears, if Clothing is chosen another combo box appears and gives you more options.

View 5 Replies View Related

Forms :: Auto Populate Date Field Based On Another Date Field

May 13, 2014

I am building an Access database for a client. It is an employee staffing database. With that being said they would like the ability to automatically populate the "T2PPCD" date field based on what is entered into the "Report Date" field. (Same table)

The date is the Monday after 180 days from the report date.

I already know how to get it to auto fill 180 days from the "Report Date" but I'm not sure how to tell it to give me the Monday after 180 days.

View 9 Replies View Related

Queries :: Using Unbound Field As Query Criteria

Dec 13, 2013

I have a value in an unbound field on a Form, which is 1234 OR 765 OR 356.

In the QBE criteria grid, I used builder to reference this form:

Forms!myform!myunboundfield

The column this is in is for the ID field, which is a number.

However, it is not filtering the data correctly. If I copy the above text and paste it into the QBE grid, then it will work. But when I reference it, it fails. If I change the value to just a number on my unbound field, it works. So the issue seems to be that its bringing across the text as a string and so perhaps effectively puts quotes around it when referencing it.

View 11 Replies View Related

Forms :: DLookup Multiple Criteria Function

Jan 31, 2015

I can't seem to get past this expression/criteria problem.

[Actual] is my field I want to grab data from
[L3-4-5] is my main table
[CDATE] is a form control where the user enters a date
[Quarter] is a number field and want it to equal 1
[Partname] is a text field and string it to equal 1

My current expression is:

=DLookUp("ACTUAL","L3-4-5","ID=" & [CDATE] And "[QUARTER]=1" And "[PARTNAME]='1'")

Although my other expression on another form works.In my if code statement I have

Me.DAYS_TRAINED.Value = DLookup("Days", "TRAINED LH A-PILLAR", "ID=" & FTM_NAME)

So I think I don't understand the multiple criteria part.

View 3 Replies View Related

Forms :: DLookup Without Criteria - Getting Value From Query Expression

Mar 23, 2014

I've never used DLookup before and I can't get it to work for me so far.

I have 1 table which contains products and different properties of each product, such as the weight of the product.

I have created a query which sums the weight of all products, but only for those that have a value >0 in a certain field. This all works fine.

Now I simply want to display that calculated total weight in a text box on a form. So I thought DLookup could be used for that. But I can't get it to work, maybe because I'm not putting in any criteria? In the control source of the text box
I've put the following:

=dlookup("[TotalWeight]","qryTotals")

I don't have any criteria, I just want the value from my qry expression. The textbox on my form now displays #name?

View 3 Replies View Related

Forms :: Multiple Criteria In DLookup Command

Nov 15, 2013

I have a form with combo box named "TEXT17" i have an another text box named(Basic Pay). How can I use dlookup creteria with two condition

EMPID= text17 value and
month in lbl9 value="mar"

I also paste my code here but show error

Me.Text43 = DLookup("Basicpay", "Salaryall", "[EMPID]='" & Me.Text17 & "'" And "[Month]='" & "Mar")

View 6 Replies View Related

Forms :: DLookup Returning Value Of First Record Rather Than Specified Criteria

Oct 28, 2013

I'm using a Dlookup in expression builder and it's only returning the value of the first record rather than the criteria I specify.

View 6 Replies View Related

Modules & VBA :: View Main Modal Form Based On Chosen Subform Record

Jul 22, 2014

I have a modal form which has a single record which is then linked to a sub-form on the same modal form. This all works fine and shows the relevant record and sub records but I want the modal form main record to change dependant on the record selected in the subform (which is basically order item history.

I found some code on another site which seemed to work for others but for me I am getting Run-time error 2465 and it doesn't like my reference to 'Me' - is this because it is a modal form?The code I am using is:

Public Function GotoRecord(RecordID As Long)
Dim rst As DAO.Recordset
Dim strCriteria As String
Set rst = Me.RecordsetClone
strCriteria = "ID = " & RecordID
rst.FindFirst strCriteria
If rst.NoMatch = False Then
Me.Bookmark = rst.Bookmark

[code]....

View 1 Replies View Related

Modules & VBA :: DLookup Multiple Criteria Not Working - Column Is A Numeric Field

Feb 25, 2015

I have a small problem with dlookup multiple criteria. Vba code looks like this:

Code:

Label34.Caption = DLookup("[Spent_Hours]", "249_1_CHours", "[Date_Added]= " & Me.Text27 & " And [Shift] = '" & Me.Text29 & "'")

This gives following error:

Syntax error in number in query expression '[Date_Added]=4.02.2015 And [Shift] = '2'.

[Shift] column is a numeric field.

View 14 Replies View Related

Forms :: DLookup Values As Search Criteria On A Form?

May 13, 2014

So I'm working on something for housing. Each house has a "Property Reference". This property reference links to all other information on the property.

There's two tables, Referral (For a tenant, with the Property Reference as a foreign key) and PropertyInfo (Holding all the property information)

Basically I want to save users as much input time as possible, so I'd prefer if they could just enter the property reference for a person, and that populates the rest of the table.

I'm currently using DLookup on the main form where it displays the information related to the property reference, obviously it's not actually being saved into any fields.

Will this method be okay if I would want to search the records by the address on the main form?

View 9 Replies View Related

Autofill Field Based On Value From Table Using DLookup Not Working

Jan 8, 2013

I am new to Access (using Access 2012) and All I am trying to achieve is to autofill the field [Frequency] from Table FullList based on the value of [Frequency] from Table Courses using a DLookup code used to update the FullList form. The code is not updating anything! It is frustrating! Frequency is a number (integer) and while Course is a text. The figures of my Access database are below.

View 2 Replies View Related

Forms :: Unbound Control In Data Input Form - Auto Fill Leading Zeros

Apr 12, 2015

I have an unbound control in data input form requiring to input a 6-digit number. I have put a validation rule restricting more than 6 digits. Most users prefer to enter, say 123 and the system can enter the 3 leading zero for them.

View 6 Replies View Related

Reports :: DLookup - Populate Textbox Based On Value That Is In Another Field On Report

Oct 20, 2014

I have a textbox on a report that I wish to populate based on the value that is in another textbox/field on the report, and I thought DLookup was the way to go - however, I cannot seem to get it to work.

I have a table (ComplaintsResponses) that has two fields, both text

[ShortDescription]
[ResponseText]

The text from [ShortDescription] is saved in a field on another table that contains all the other relevant information that is used in the report, and whilst this short description is mostly fine, I have one report where I need the data from the larger [ResponseText] field.

I have tried the following code:

Code:
=DLookUp("[ResponseText]","[ComplaintsResponses]","[ShortDescription='" & [Reports]![PublicComplaintsArea]![txtSAPCRMResponse] & "'")

and

Code:
=DLookUp("[ResponseText]","[ComplaintsResponses]","[ShortDescription='" & [SAPCRMResponse] & "'")

Both of which return a #Error in the text box.

The field that contains the text that is used for the lookup is SAPCRMResponse, and the textbox on the report itself is called txtSAPCRMResponse.

View 2 Replies View Related







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