473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Using If in an Access 2003 Form

I have a form with a combo box with the name sold to , that list a list of citys.
I have a text box named fright. when a vlaue for a city is slected I want the text box freight to enter a value for the feight

iff sold to is = to x then freight is y
is this possible ?
Jan 20 '07 #1
3 2193
nico5038
3,080 Expert 2GB
You can always add an unbound field with an IIF statement.
Just make sure it's a newly placed field and use something like:
Expand|Select|Wrap|Line Numbers
  1. =IIF([recordfield]=1,"1","2")
Another option (when you have multiple values differing per city) is to make an additional field in teh city table and extract that with a DLOOKUP like:
Expand|Select|Wrap|Line Numbers
  1. =DLOOKUP("Freight","tblCity","City='" & me.comboname & "'")
Nic;o)
Jan 21 '07 #2
You can always add an unbound field with an IIF statement.
Just make sure it's a newly placed field and use something like:
=IIF([recordfield]=1,"1","2")
Another option (when you have multiple values differing per city) is to make an additional field in teh city table and extract that with a DLOOKUP like:
=DLOOKUP("Freight","tblCity","City='" & me.comboname & "'")

Nic;o)
I thank you very much for your reply. I am very new at this and I have to say that I am not the sharpest knife. I have worked with this for weeks and about to go crazy. I know this must seem very simple to you but it is very hard for me.

This is what I am doing
I have a combo box named Sold to, It displays numerous citys to pick form.
I have a text box named freight. (if sold to = clyde ,then freight would = $125.00)
Control source =IIF([sold to]=clyde then 125)
I know this must seem very simple to you but if you could please take a minute to show me what I am doing worng

In the book I have it states that if you have more than three iff you should use a slect statement would the dlookup do the same?
Jan 21 '07 #3
nico5038
3,080 Expert 2GB
When your cities from the combobox are recorded in a table, I would add the freight field to that table.
This will allow the extraction of that value using the name of the city with the =DLOOKUP() function I proposed.
When you have a value list for the combo, then create a tblCity to hold the cities and the freight.

Getting the idea ?

Nic;o)
Jan 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sabine Oebbecke | last post by:
Hi Experts! I have several forms and reports where controls get their values with 'Forms!MainForm!Control' or 'Forms!MainForm!Subform!Control' resp 'Forms!MainForm!Subform.Form!Control' which...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
7
by: Mike Nygard | last post by:
I'm experiencing extremely slow response times in design mode of my forms since moving to Access 2003. Simply dragging a button to a different position on the form takes 30 seconds or more. The...
0
by: David G. | last post by:
The keyboard type ahead buffer does not seem to work in Access 2003 in certain situations. We would like some help with this. Here are the details. We have a large program that was developed...
1
by: Jason Hickey | last post by:
Has there been a change in the way the UI designer handles winform inheritance in the 2003 version of visual studio. Consider the following (try it if you are using 2003 Everything seems to work...
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
5
by: Lysander | last post by:
My collegue had to buy a new laptop that came with Office 2007 already installed. She had Access 2003 installed on top, in a different directory. None of our 2003 databases will run on her...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.