iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-29-2004, 08:12 PM
richkoi's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Atlanta, GA
Posts: 451
richkoi RepRank 0
Default Simple Inventory Managment - Item Codes

I am using MS Access to create an inventory database so I can run queries to do product counts/analysis/etc... The best way to make tables work together is to use a key. I would like to create a key code for my inventory that is intuitive so I have come up with the following:

Examples:

ITEM NAME: BAMBUSA OLDHAMII
ITEM SIZE: #15
CODE: BAMOLD15

ITEM NAME: PHYLLOSTACHYS NIGRA
ITEM SIZE: #05
CODE: PHYNIG05

My question is: Is there a way to have Access automatically generate this code based on the ITEM NAME and ITEM SIZE fields? Please let me know if this is possible.

Thanks,

Rich
__________________
Me
Reply With Quote
  #2 (permalink)  
Old 12-29-2004, 11:34 PM
RikR's Avatar
WebProWorld Pro
 
Join Date: Oct 2004
Location: Wake Forest, NC USA
Posts: 130
RikR RepRank 0
Default

You should be able to fill the field by taking left six charectors of name and right two charectors of size and putting them together to form the code.

I don't remember the details but I think it is pretty basic Access stuff. I remember reading about it when I read one of those big 900 page Access books once.
__________________
Rik Rasmussen
Two Way Radio Directory
http://twowayradiodirectory.com
Reply With Quote
  #3 (permalink)  
Old 12-29-2004, 11:37 PM
RikR's Avatar
WebProWorld Pro
 
Join Date: Oct 2004
Location: Wake Forest, NC USA
Posts: 130
RikR RepRank 0
Default

I thought the keys were always auto-generated and sequential.

You may have to let Acccess do the keys it wants, and you create your code number, or stock number.
__________________
Rik Rasmussen
Two Way Radio Directory
http://twowayradiodirectory.com
Reply With Quote
  #4 (permalink)  
Old 12-30-2004, 01:41 PM
richkoi's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Atlanta, GA
Posts: 451
richkoi RepRank 0
Default

Quote:
You should be able to fill the field by taking left six charectors of name and right two charectors of size and putting them together to form the code.
Yes, that's what I want to do, but can't figure out how to do it.

Anyone know where there is a tutorial explaining this?

Thanks,

Rich
__________________
Me
Reply With Quote
  #5 (permalink)  
Old 12-30-2004, 03:01 PM
RikR's Avatar
WebProWorld Pro
 
Join Date: Oct 2004
Location: Wake Forest, NC USA
Posts: 130
RikR RepRank 0
Default

Search Access Help for:

"Extract part of existing text values using a calculated field"

Result:

Extract part of existing text values using a calculated field
In query Design view, create a query. Add the tables whose records you want to use.


To find values in part of a field, use the Left, Right, or Mid function in an expression in an empty cell in the Field row in the query design grid.
The syntax for these functions is:

Left(stringexpr,n)
Right(stringexpr,n)
Mid(stringexpr,start,n)

The stringexpr argument can be either a field name (enclosed in brackets) or a text expression; n is the number of characters you want to extract; start is the position of the first character you want to extract.

The following table shows examples of these functions. If the value in
Part ID is This expression Returns
BA-7893-R12 Left([PartID],2) BA
BA-7893-R12 Right([PartID],3) R12
BA-7893-R12 Mid([PartID],4,4) 7893


Add any other fields you want to include in the query to the query design grid.
__________________
Rik Rasmussen
Two Way Radio Directory
http://twowayradiodirectory.com
Reply With Quote
  #6 (permalink)  
Old 12-30-2004, 03:58 PM
richkoi's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Atlanta, GA
Posts: 451
richkoi RepRank 0
Default

Thank you! That is very similar to the way it is done in Excel.

Thanks again,

Rich
__________________
Me
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:11 AM.



Search Engine Optimization by vBSEO 3.3.0