Microsoft Access 2007 question

  • Thread starter Shaun Culver
  • Start date
In summary, you would need to replicate the price in the second table based on the items in the first table.
  • #1
Shaun Culver
69
0
I have two tables that I would like to link in a specific way. Both tables have a field name labelled, for example, "Price". Both also have a field name labelled, for example, "Item type".

In the first table, each of my stock items are listed in the "Item type" field, with the corresponding price in the "Price" field.

Now the problem...

In the second table, I have many sales receipt entries, with the item types entered (sorted by date), but no entries in the price field.

How do I automatically transfer the price to the second table based on what is entered in the first table?
 
Technology news on Phys.org
  • #2
Sounds like homework to me.
Try looking up the update and join SQL commands.
Post your attempt at the SQL for this it you still have problems, although the Update Wizard will probably do it for you.

Note: Replicating the price field probably isn't a real good idea and your stock table should have an effective date in it.
 
  • #3
Nope, not homework.

I am new to Access and databases, so I do not understand how to implement SQL code. Are you referring to this:
http://www.sqlcommands.net/sql+update/

What is the "update wizard"?

Excel allows a "by hand" method for this. By typing a, for example, "Price" in block A1, and then dragging the bottom left square icon down, you may replicate the same entry n number of times. Is there something similar in Access? By filtering the records according to "Item", the same price can be applied to all records.
 
  • #5
While some concepts are shared between spreadsheets and database the implementation and terms used are different.
Even in Excel you don't have to do that by hand.
Multiple sheets and a macro will do it for you.

In general you need to know what the commands in the link you posted do.
The wizard is query tab -> new -> update.

For filtering in the case you mention you would join the two tables on item_type.
The command Update ... Set can the replicate the fields.

There are several ways of writing this in SQl, here is one approach

Update receipt
Set receipt.price = stock.price
From receipt
Join stock On receipt.item_type = stock.item_type;

This may not be entirely correct since access tends to be bracket happy.

You probably don't want to do this though.
You can join the tables anytime you want the associated data.

Edit: should have looked at the post again, I got called away for a while.
Good luck.
 

1. What is Microsoft Access 2007?

Microsoft Access 2007 is a relational database management system developed by Microsoft. It is a part of the Microsoft Office suite and is used to store, organize, and manage large amounts of data.

2. What are the main features of Microsoft Access 2007?

The main features of Microsoft Access 2007 include the ability to create tables, forms, reports, and queries. It also has a user-friendly interface and supports data import and export from other applications.

3. How does Microsoft Access 2007 differ from other versions?

Microsoft Access 2007 introduced a new user interface called the Ribbon, which replaced the traditional menu and toolbar system. It also added new features such as the ability to create multi-value fields and store attachments in the database.

4. Can Microsoft Access 2007 be used for both personal and professional purposes?

Yes, Microsoft Access 2007 can be used for both personal and professional purposes. It is commonly used in businesses to manage and analyze data, but it can also be used for personal projects such as organizing personal finances or creating a contact list.

5. Is it necessary to have programming knowledge to use Microsoft Access 2007?

No, programming knowledge is not necessary to use Microsoft Access 2007. It has a user-friendly interface and allows users to create databases, forms, and reports without any programming experience. However, some knowledge of SQL may be helpful for more advanced operations.

Similar threads

  • Computing and Technology
Replies
10
Views
906
  • Programming and Computer Science
Replies
27
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
646
  • Programming and Computer Science
Replies
0
Views
511
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
  • Computing and Technology
Replies
1
Views
957
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
2K
Back
Top