473,387 Members | 1,569 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,387 software developers and data experts.

Form Help with updating columns

6
Hi.

I am a newbie and am trying to build a form for a daily dietary menu.

The problem I am having is that the form, which is based on a query to the primaryfood table does not update all the rows, based on the food.

To explain, I have 4 columns and a primary key in the table (AutoNumber). The query call all the fields.

The form then has for distinct columns:
Food Name
Fat Grams
Carb Grams
Calories

The form is in an Excell type format.

The problem is that when I use a list box and either search and select the food name, say, Big Mac with Cheese the Food column in the form changes but the corresponding values for the fat, carbs, etc doesnt. How can I make the form do that?
Any help or hints will be appreciated.

-Bob
Aug 21 '07 #1
1 1206
missinglinq
3,532 Expert 2GB
If I understand your post, you want to select a food and retrieve the associated dietary values, i.e. grams of fat, protein, carbs and so forth. If this is correct, the easiest way would be to use a combobox instead of a listbox, and leave the creation of the retrieval process to Access, by way of the Combobox Wizard.

First you must have your form set up to display the records you want to retrieve, i.e. the form's Record Source should be the table/query that holds the data. You must have textboxes that have as their Control Sources the fields for fat, protein, carbs and so on. Then simply:

Add a combo box to your form. The Combobox Wizard will pop up.
Select "Find a record based on the value I selected in my combobox."
Hit Next.
The table/query that the form is based on will be selected and the fields will be listed on the left hand box. Click on the field you're searching by (in this case the FoodName field) to move it to the box on the right.
Hit Next.
Size the column to show the fields. This works just like sizing columns in Excel or in a datasheet form in Access.
Hit Next.
Name the combobox.
Hit Finish.

Now you can drop the combobox down and scroll down to the item to search by, or you can start to type in the item, and the combobox will "AutoComplete" as you type (an advantage the combobox has over the listbox.)
Hit <Enter> and the record will be retrieved with fat, protein, carbs etc filled in.

You're done!

Welcome to TheScripts!

Linq ;0)>
Aug 22 '07 #2

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

Similar topics

9
by: allenj | last post by:
DB2 UDB 7.2 WSE Fixpak 9 Linux Red Hat 7.3 I have some library code (written in Java, if that matters) that processes maintenance screens that are presented to the end-users as forms in a...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
1
by: Mike | last post by:
I have an ASP.NET/VB app that updates values in a DataTable over the course of about 3 different pages. On the way out of the first of these pages, I explicitly build the DataTable from values in...
0
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables...
1
by: Mike | last post by:
How can I implement a Form which has a DataGrid displaying data from MS Access/SQL Table but instead of updating using the Data Grid I would like to be able to bring up a Form for Data Entry as...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
8
by: markjerz | last post by:
Hi, I basically have two tables with the same structure. One is an archive of the other (backup). I want to essentially insert the data in to the other. I use: INSERT INTO table ( column,...
0
by: piercy | last post by:
Hi, Im tyring to display a dataGridView with comboBoxes on about 5 of the fields. This table is basically permissions to certain parts of my program. In the database i just store a 1 or a 0 (access...
5
by: Bogdan | last post by:
Hi, I have a stored procedure that uses JOINs to return columns from multiple tables. I also have another stored proc that that takes a series of params and updates multiple tables. I used the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.