How To Model A Field That Manifests Itself In Two Ways
Dec 1, 2005
Here is my problem:
Say I have a products table:
PRODUCT
========
Prod_id
Prod_name
Dept
Type
:
It is now possible that some of the products can also be a product
group, and a product group would then consist of multiple products.
(Note: if a product is a product group as well, both of them have
the same names. therefore for consistency, if in future someone
alters the product name, that should be reflected for the product
group if that product happens to be a product group as well)
So, I started of by thinking that the products table should contain
a binary filed like "Is_this_a_ProductGroup", where for any product
that is also a product group, while creating or editing the product
the user would flag this field "Yes" and "No" otherwise.
S, my revised products table is like:
PRODUCT
========
Prod_id
Prod_name
Is_it_a_ProductGroup
Dept
Type
:
Based on some earlier suggestions in this forum, I tried to create a
junction table like
and joined the Prod_id above to the Prod_idin PRODUCT table and
created a copy of the PRODUCT table and joined the Prod_Group_id to
Prod_id in the PRODUCT_Copy table.
I would like some help now on:
1. whether this design is really correct?
2. If so, how does one go about the process of data entry through
forms for these tables?
I've been here for two months and answered over 400 questions. I'm seeing a pattern here, and I have decided to post the best ways to make sure you are never answered.10) Blood, sweat, and tears are for losers. Spend no time figuring things out on your own.9) Announce almost ceremoniously that you have no VBA experience.8) Fail to use the search functions of this forum.7) Try to put every example you're given into a macro.6) Believe that this is the only source for answers, because Access Help provides nothing. Nothing, I tell you!5) Have us write your homework for you and then complain when you don't understand it.4) Post in German.3) Have a belief that your particular problem is the most important issue ever, and post in every sub-forum possible. Then bump it.2) Be vague, and then be belligerent.1) Have no appreciation for the people that are answering your questions in the first place. I know this sounds cold and mean and otherwise uncaring, but we are here to answer questions, not give you fish, as it were. This is a place to say, "I've done most of the work, but I need help over this hump," not "I have this crazy project/idea and I want you to write it for me." I've written over a dozen example DBs for people, and I know that I know what I'm doing. But, myself along with perhaps the majority of others that answer the majority of the questions, I'm asking on their behalf to please take the time to figure some of this out. If you can't do VBA, you are using 25% maybe of Access. If you can't understand your own DB, then asking us to fix it is a solution, but not a learning opportunity for you. If you can't understand what I'm getting at, it's that so many posts are the same. Again, I'm not trying to be an ass, but if you want to be a decent Access programmer and a programmer in general, then please, take the time to learn it. There are plenty of books (look at the bottom of this forum) and there are plenty of resources. I don't think any of us are teachers by trade, but the best teacher for something like programming is always trial and error. Programming is a language, a passion, a "something you figure out" if you will. If you're spoon-fed the entire time, you don't learn. I will continue to answer as I always do and I apologize if anyone was offended, but jeez, make sure you've tried everything offline before asking for help. And don't forget to search first, both here and Google.Sorry for the long read. :)
Hello, I was hoping someone can help me how to put the following statement in right format. I have 4 fields idResult, QuestionNumber, Description and Result.
So If Question Number and Description have same idResult then Result is (results are defined in the table) there are 30 combinations.
I have set it up and now need to create an invoice section. An invoice needs to be issued every month and is worked out on a percentage of works complete. For example in one job there may be 10 items of work and for 8 of these iems 25% of the work is complete and the other 2 no work has started. Therefore my invoice needs to be able to calculate 25% of the value of the 8 items and work out a total price to be invoiced. Each time an invoice is created I need to be able to store the invoice value and the percent value of each item complete. Does any one have any ideas as to a good way of doing this. That is if you can undersatnd what I am asking for. Thanks for any help.
I'm trying to find out what's the best (or good ways) to open and close a database (*.mdb) in ASP without worrying about it staying open. The website stops running (page not displayed) after it has been visited several times I think, or it's happening when I'm creating new scripts I made which crash several times during debugging. Not sure what's causing it.
Here's how the db connections work. I'm basically using (includes) to do lots of this.. every web page that requires the DB, I do this format...
(includefile: open database) (includefile: create constants/variables) (includefile: load functions used) - the html page, which access functions when needed - (includefile: close database)
the includefile that holds all the function scripts does not open or close the db at all but only the recordsets semi-example function (function) rs.open "", cn <--- the cn was opened in the database script - blah = the stuff - rs.close (end function)
Is this a good way to work with the database? I'm using access. Yes, i know sql servers are better, but I was told that since I have only access, I want to minimize the number of connections, so I open the database once during the page being opened, and close at the end of the page.
Like I say, the problem is, the site works great for a while (no real visitors yet as it's new), but it suddenly says "page not displayed" after a while. NORMALLY this happens when I'm making new functions/webpages and did the coding wrong while the database is still open. I'm thinking it's crashing because there were too many errors during the database being open.
PLEASE HELP!
BTW, is it possible to just run a script that finds ALL the open connections after a crash and close them?
I am currently building a db that will handle information on many events around the world. What I would like to do is set a check box that when people scroll through the different records they could check it and it (the current record they are viewing) will go into a compiled list wherein the iindividual record details of that list which the user created by their choices could be exported to an excell sheet (to automate a reporting need in the job) I have seen functions like this in large websites particularly the classified job sections in the seattle Times . where as you scroll through you see something you like you mark it continue scrolling mark another and then when you are all done you go to a page that has all and only your selections.
Can anyone tell me where to start on this one what am I Looking for Etc. This will be the next big step in this my first database. All help greatly appreciated
Hi I have designed a database for a small organization. It is a ver small database. can any one verify and tell me the mistakes in my design. It hardly takes 20 min for the people like you. This is my first step in designing. I am attaching the zip file which contains dbm file and business requirements. Complete physical data model is there.
especially in "category_tests" table i feel that i have done some thing wrong.
I am trying to build a table that lists aircraft viewed by plane spotters.
In the “aircraft_spotted” table I have two look up wizards. The first lists the make of aircraft and the second lists the type.
What I am trying to do is filter the models down to the maker. If I select Boeing I will only get Boeing models and nothing else. The same would apply to Airbus and so on.
I would like to keep this information contained within the table without using a query but if I have to use the query for the model lookup then so be it.
What's up everyone, I'm new around here and to db design as well...
I'm posting a really rough data model for the first real database I've been putting together.
I'm still in the early stages, and the concepts behind db design are still pretty foreign to me, so there are bound to be many errors I hope to iron out ASAP.
One specific question:
On all of the data models I have referenced, the "OrderDetails" table has no primary key, can someone help me to understand this? Or explain how it is wrong... Thanks
I was hoping some of the experts and advanced users around here could take a look at this and help steer me in the right direction.
I have a fairly complete data model, my question is, how best to create tables for entry where I do not have subform after subform, and subforms in subforms. With subforms for the subforms and subforms on top of that.
I am about to start pulling out some teeth because at this point it sounds fun compared to this!
Do I need to use a query to base my table off of to build my Customer entry form? Or is my only option to use 15 frikin' Subforms? I I use a query, does that cause problems with data integrity?
I am having trouble finding useful reference to this, both online and in books I have purchased.
Normalization is fantastic, I understand.... But besides the crumby Northwind sample DB that everyone and their brother directs you to, is there an actual useful sample to look over that illustrates the use of a normalized data model?
I have grown more than a bit irritated with this, mainly because of my own inablilty to make progress in putting this project together.
I would like to create a simple to use, streamlined systems that promotes efficiency and speed, not a super convoluted system that has 85 subforms on every form in the DB.
I would REALLY appreciate some feedback/direction here, I am about to give up on normalized data and go with a simple flat table approach.
I would rather have redundant data than indecipherable forms that I have to answer incessant questions about.
In my transaction table, I would like to find out the latest transaction dates of each family models. It sounds a simple Max function can get the desired result. However model number consists of the first 6 characters for the family model and the rest for the versions (variants). The Max function fails to work in this scenario. Is there any other way to group the model numbers once the 1st 6 characters are identical (the rest is ignored)?
I am looking for a data model to define and track proficiency/currency.
Example:
You earn a licence to do X. You need to renew your licence every 2 years or so. But also, to maintain currency, you need to do what the licence gives you the right to do often enough, or else you need to do a test.
Specifically, you need to do X a specified number of times N within, say, last 3 months at any one time to maintain currency. If you have lost your currency, you need to do a test/check. So at all times, you need to have N times on record within last 3 months, or a test.
In addition, to do X legally, you also need to document that you have done X at least 10 hours within, say, last 6 months, or that you have another test within those last 6 months. This is independet of the previous requirement (concerning the number of times you did X).
Both requirements must be fulfilled at all times for you to do X legally.
So, any suitable model out there? Essentially, something capable of defining and tracking currency for various ratings and license privileges of pilots would do just fine.
Hi, I've been working hard at learning Access for past two months and spent a lot of time Googling and speeding through Alison Balter's books and at a slower pace the Paul Letwin’s Developers Handbook set (fantastic but I probably need a year to absorb the incredible detail).
I've built a prototype reconciliation tool using the recommended FE-BE model. I opted for a total ADO solution and have had great success in putting together a fast and useful tool for 10+ users.
I avoided using Workgroups in my design and developed my own basic sign-on authority model which allowed an Administrator (don't confuse with Admin user in Workgroups) to add new users who can use the Access app. The allowable users and which ones are signed on are stored in the BE. This all works reasonable well until network issues occur and the signed on user record on the BE is not reset as should be if the user signed-off genuinely.
This is where I realised I need to be able to monitor who is connected to the BE. There is a way of doing that using ADO which I can get to work. I then noticed because all users are signed on with Workgroup Admin as default I could not differentiate between users. I then decided to implement Workgroup authority retrospectively.
I decided to place the .mdw on the LAN with the BE (this seems to go against conventional wisdom but could not workout how else I could achieve what I wanted to). This enables the two Administrators in different places to maintain users via the FE. I use the /wrkgrp command line flag to point to the correct .mdw.
I then started getting all sort of problems . . .I'm still in testing . . . not so bad but deadlines are looming and I'm worried.
Sorry, I digress. . .the problem I seem to be getting is when I open the FE :
Run-time error -2147217843 (80040e4d) Cannot start your application. The workgroup information file is missing or opened exclusively by another user
I also have problems developing the FE with the workgroup file in place. It seems to complain about another user is locking the FE.
The problem is a little verbose but just trying to paint a picture . . .now, this is what I'm after. . .I need the following ability:
1. Two Administrators who can maintain users. When a new user is added the Administrator chooses a password. 2. When the new user signs on the user is prompted to enter new password. 3. The administrators can view who is genuinely signed on and reset accounts appropriately.
I am currently studying the Access Security sections in the Paul Letwin book to better understand what is going on. It does seem retro-fitting an app to a workgroup model is not straightforward. Admittedly, I should have considered Workgroups in my design before starting (I will know).
Thanks for staying with me if you're still reading . . .any suggestion/pointers would be great.
I have researched the 'party' data model but it is a bit too complex for what I'm seeking. For those familiar with it, I don't really need the intermediary relationship from-to tables.
I'm interested in ideas about setting up a data structure that will allow users to search contacts or select contacts in dropdowns regardless if the contact type is a person or an organization.
Obviously the fields needed for both are different and the biggest issue is the name field because the person contacts are
The way I am accomplishing it now is writing the company name, or "first name " & "last name" for a person, to kind of a bridge table when a new record is inserted into the person table or the organization table...kind of inefficient.
Is this a relationship thing or should I just write a function to create a temporary recordset when needed?
I currently have a query of between dates which the user enters, but when I try to get a total count of model numbers it gives totals for each date. I am trying to get a count of model numbers between these dates with the dates excluded in the grouping.
1) I am pretty newbie to this access programming, do forgive me if my questions sounds stupid.
2) Basically I create an application in access capturing or production information for my company. now the top management suddenly wanted whats their main concern:- Total Daily/Monthly, Quarterly, Annual Sales (By Model If possible)
3) I start with daily (Lets don't be too overly ambitious).
4) I try to let user select dates from my calender control and reflect daily sales (in Total & By Model break down) insert into my form.
5) Understand someone told me from my previous post in Calender control I can achieve it either through forms or queries, which is a better way. (in terms of flexibility to change for program maintenance/ scalibility) wise ?
How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.
In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.
So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.
Here is what I am trying to do. I have a query with 2 fields. "Time In" & "Time Out". What I would like to happen is this. Whenever a character, let's say a "t", is entered into that field I would like the current time to populate that field. Right now we are actually typing in the time. I have the fields set up as DateTime fields currently.
I've just returned to work after kids and started managing a large Access database related to health, back-tracking over many years.
Currently in filling a form we physically enter: Apples 2.2 red apple 2.4 red apple cut 2.45 Oranges 5.6 Cucumbers 8.5
Is it possible to get field 2 to automatically fill with a number code due to the text typed in field 1?
FWIW, I'm confident at more basic Access e.g making follow on default value = Dlast("field""table") type stuff but the more complex stuff I haven't touched since Uni over a decade ago and you will need to be gentle while I blow away the cobwebs
Within my table if Field 1 has an answer of Self (from drop down), then, I would like Fields 6-12 to auto populate; however, if Field 1 does not have an answer of Self, then leave Fields 6-12 blank.
I am not quite sure how to lay this out. I am using Access 2010.
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
I have my Assets form and the primary key is the ChargerID, in this form I have an "Add New Job For This Asset" button, which opens up the Jobs form at a new record.
How do I make it so that the ChargerID field is automatically filled with whatever the previous record was instead of being blank.
For example if I have Charger12345 open in the Asset form, I'd like to click the Add New Job button and it automatically have Charger12345 in the ChargerID field of the Jobs form.
I'm pretty good with setting up a very simple database such as inventory, profiles, etc.. However I'm creating a database to keep track of a football (soccer) team's players and match statistics.What I have so farsample attached)
Tables: * Players - PlayerID, Fname, Lname, position, goals, assists, etc (all details regarding a player) * Position - Positons (Table containing positions eg: defender. Data is selected in player's form as a combo-box) * Competition - Competition types (Cup, League, Friendly. Data is selected in Match's form as a combo-box * Venue - similar to Competition table * Opponent - Similar to above two tables * Match - MatchID, Competition, Venue, etc (form corresponding to table attached)
Forms: * Player form * Match form
Now as shown in the sample, I choose players using the combo-box. Then whatever stats they had during the match are entered on the fields provided. How to link the player (selected using combo box) to the stat fields (goals, assist, YC, etc).
I am trying to do some simple table operations. I have a field (Date) containing dates, and an empty field called Day.
I want to extract the day number from the Date field, and write it to the Day field.
I didn't get very far until I ran into trouble when setting my recordset. I get the error "Too few parameters, expected 1". Clicking "Debug", will highlight the code line "Set rs = db.OpenRecordset(sqlString, dbOpenDynaset)".
So far, my code looks as follows:
Code: Private Sub Command16_Click() Dim db As DAO.Database Dim rs As DAO.Recordset Dim sqlString As String Dim dataDay As Byte 'Open connection to current Access database Set db = CurrentDb()
[Code]...
I am not very familiar with the various types of recordset settings. I just want to be able to read data from the Date field, and write data to the Day field.