Can A Default Table Value Be A Calculated Value?
Jun 23, 2005
Hi all,
I have a table...
Amount........Wholesale...........Commission
Lots of other columns but they don't come in to play.
When an Amount is entered, can Wholesale and Commission auto populate with Amount*.9 and Amount *.1 using default values in the table definition? I couldn't quite get the expression builder to understand.
If it can't, how should I get it to work? Forms are OK. As is code.
Thanks
PB
View Replies
ADVERTISEMENT
Feb 13, 2006
Hi Everyone,
I hope someone can help.
I have a form with a combo boxes and a table with relevant list and additional field, fldDefaultDrive (Yes/No Field).
Currently in order to set the default value, I have used the following code for each default;
Private Sub Form_Load()
Forms!frmMediaLabeller!CboDriveName.DefaultValue = """D"""
End Sub
However, I want users to be able to go into the table and change the default value if thier CD player default Drive is anything but D: Drive. I have tried to replace the D above with an SQL statement but with no success.
Private Sub Form_Load()
Dim Drivename As String
Drivename = SELECT tblMediaDrive.fldDrivename FROM tblMediaDrive WHERE (((tblMediaDrive.fldDefaultDrive)=-1));
Forms!frmMediaLabeller!CboDriveName.DefaultValue = """Drivename"""
End Sub
This is definetly not working, can anybody help, I have a feeling it is syntax but not sure where? :confused:
Robert88
View 7 Replies
View Related
Jan 21, 2005
Hi everybody,
Beginner here needs help !
I'm building a make-table query for which if the result is null (no record correspond to the set of criterias), a default message like "there was no activity during the period" would appear in the table (not a message box...I need the message in the output table). The best I could think of is an IIF function but it doesn't seem to work... Is there any way to do this without using VBA?
Thanks in advance !
View 1 Replies
View Related
May 13, 2015
I have what is probably a stupid question but I've been struggling with this one for a while. I have an ordering database which has an Orders table (containing Order ID, Date, Supplier etc) and an Order Line table within which I have a combo box for Product name, supplier, price, VAT rate, Line price etc. At the moment, I have the order line table as a subform within the Order form (run from the Orders table). The problem I'm having is the subtotal and total fields. At the moment these are in the Order Line table as I cannot figure out how to get these in the Orders table. In summary, can I make a calculated field in one table that calculates values from another table (linked by Order ID)?
View 3 Replies
View Related
Jan 13, 2005
Is there any way I can have a default value in a table set to the value in a field in another table?
I have a table that has event information including the number of the event, e.g., this year is the 51st one. This event information table only has one line because after the event I'm going to save the record to an archive table and then update the information for the next year.
I have another table with participants in the event and records for it come from a form. I'd like to have it so that it automatically inserts the event number for each record. In this way when I archive that information, we'll know which event the participant was involved in. The participant could be involved for a number of years.
I'd rather not have the input person have to type in the event number every time. Doing a combo box also involves an extra step for them. It seems like I ought to be able to automate this info. I don't know anything about VBA.
Would one of you help me? By the way, I've learned an awful lot reading on this forum. I can't tell you how many problems you've solved for me. Thank you.
View 2 Replies
View Related
Apr 4, 2006
Hello,
I have a field named dblNumber and I want it's default value to be it's value in the previous record + 1. How can I do this ? If it's not possible in a table, can I do it on a form?
op.: I don't wan't to use the "autonumber" option...
thanks
m.
View 6 Replies
View Related
Feb 7, 2007
Hello, I have been looking around trying to gather as much access info as I can. I could really use some help with what seems like it should be pretty basic to me. I am making database for excavation estimation and have a table with my equipment and a field for default costs. I then have a table where I assign costs to a specific job. So I would choose a piece of equipment from the equipment table and then would like the default values entered in from the equipment table into the job table for the default costs. So a default value is put there that can be edited for the specific job. I am guessing I need to enter something into the default data area on either the table or on a field on a form? Can anyone give me the format for putting this in. The primary key in the equipment table (auto-number) is linked to a foreign key in the job table. Thanks in advance.
View 1 Replies
View Related
Dec 14, 2004
I made a table with a Date and Age field. If I have typed in 12/14/04 for the date and 25 for the age in the first record, how can I make Access display 12/15/04 and 26 in the next record automatically, then 12/16/04 and 27 in the next record after that and so on (as a default value for new records). I have tried the different built in date expressions, but I always get a type mismatch error. Can anyone help me with this? I am sure it's simpler than I think. Thanks.
View 3 Replies
View Related
Dec 28, 2005
I am making a default value statement in a table that looks like this
IIF([company name] IN(“name1”, “name2”, “name3”), Date()+14, Date()+30);
this statement says that if the companys name is any of the names in the list, then the date outputed will be todays date +14, otherwise, the date will be todays date +30.
whenever i try to use the statement, access keeps giving me the error...
"you omitted an operand or operator, you entered an inalid character or comma, or you entered text without surrounding it in quotation marks"
what is wrong with my statement??
View 5 Replies
View Related
Feb 15, 2007
I'm using Access 2003 to write reference books. I have a field labeled Title Page and one labeled Source Page. 9 times out of 10 the Title page is the same as the source page. So, how can I put in a default value that the source page is the same as the title page, but then I'm allowed to go in and change the source page in the rare instance when they don't match. I'm fairly new to Access, though not to database programs.
View 2 Replies
View Related
Nov 12, 2004
Hi folks,
Is there a way to have a calculated field within a table? I have a table that I've added four fields to: AmountIT, AmountRE, AmountKK, AmountRes. I want to be able to sum these four fields to give AmountTotal, but is there a way to have in a table?
View 8 Replies
View Related
May 23, 2005
Im not sure the best way to go about this and would be most grateful if I could be pointed in the right direction.
If I had a table called tblEmployee and a field within it called "PayRate" and another table called tblHours with a field in it called "LabourCost" and a field called "Hours". What is the best way to hold the "LabourCost" value so it doesnt get affected if someones "Payrate" is changed.
I expect I have asked this all incorrectly and I really do apologise.
Many thanks in anticipation... :)
View 4 Replies
View Related
Mar 31, 2006
In an orders table, i want to have a total value calculated... in the table... i was only able to do that in a query... but is it possible to do so in a table?
View 6 Replies
View Related
Jan 31, 2006
Is there a way to get a calculated Control of a form to end up in the underlying table?
View 2 Replies
View Related
Oct 27, 2013
I have a form where it is necessary for the user to input number of tanker loads, however I would ideally like the table to store the information in m3 which means multiplying whatever the user inputs by 11.3.
My plan was to use an unbound textbox for the user to input the "number of loads" into, then use a query to calculate the value and then a Dlookup to update the value of a control which will be hidden somewhere on the form. I got as far as making the query however then realised that it won't let me add an unbound textbox to a query in order to form an expression. I'd like to stay away from the inbuilt "calculated field" option just in case i need to downgrade to an earlier version than 2013 at some point.
View 1 Replies
View Related
Oct 12, 2015
I am calculating a field fldD. I have added the following to the Control Source of fldD "=[fldA]+[fldB]+[fldC]"
Can I save the value that is created back to the table i.e. fldD will be the value of =[fldA]+[fldB]+[fldC]
View 1 Replies
View Related
Mar 30, 2007
I am very inexperinced with Access, please be kind.
My problem is that from the form view the simple division of 2 #'s are placed in the correct text box I selected, but I am unable to get the value to enter into the data table. Please help.
Thank you
View 4 Replies
View Related
Apr 20, 2007
I know that it is bad form to store a calculated field in a table - normalization and all that - but I can see no other way around a need that I have.
I'm trying to make a database to store injury time for employees. If an employee is injured, he can do light work for a certain amount of time, but this light work need not be contiguous. But, the total time on light work must be known so as to see when it is used up.
For example:
Bob is injured on 4/1/06 and goes on light work on 4/2/06 until 4/5/06 (4 days). Bob is then taken off light work until 4/10/06 when he reinjures the same injury. This does not count as a new injury, because it is an aggravation of the old one. So, Bob goes back on light work on 4/10/06 until 4/15/06 (6 days).
So, I need to store Bob's total time on light work for this injury (10 days) so that I can keep a running total to check against the maximum for a single injury. All I can think of is to store the sum of days on light work as a field in Bob's injury record, but that means storing a calculated field in a table.
Am I missing an easy way to do this, or is there a method to do what I want that I am just not aware of?
Thanx for any help!
View 2 Replies
View Related
Aug 10, 2007
Hi,
I know it breaks all the rules to store a calculated field on a table, but I've painted myself into a corner with the way I built this particular database, not good, I have repeating groups and basically the whole database is built this way. I need one form to store a calculated value on a table to solve a problem on a report that encapsulates the total of all the repeating groups. Before you start the lecture, I know I messed up, but this is way to far down the road to start over. Any help would be greatly appreciated.
Gary
View 13 Replies
View Related
Feb 12, 2008
Is it possible (and logical) for me to create a table with a calculated field from 2 other fields in the same table? Example; I have a long time field (mm/dd/yyyy hh:mm:ss) aka StartTime, and a long time field EndTime. I would like to subtract the StartTime field from the EndTime field to get the total time elapsed, but in hh:mm:ss format. I can get it in hh:mm format, but I really need the hh:mm:ss format. Any Ideas? :cool:
View 4 Replies
View Related
Sep 14, 2006
I have a small Database that produces invoices, Each invoice could have 5 items on it which are compeleted at different Dates. (cutting hair in an OAP Home) Invoice to be produced at the end of each month which shows what happened each week. This will be generated for each person in the home. I can display all the information in a form when inputing the invoice information. I want a button to copy the invoice number the client name and the total of the invoice to a new table. The total of the invoice is calculated control on the form.
How do I do this??? can anyone help
I need a total in a table to substract payments from.
All Help will be much appreciated.
View 1 Replies
View Related
Sep 18, 2006
Hello,
I have been reading various threads about this subject and I know that one shouldn't store a calculated field in a table.
I believe this may be an exception to the rule (but I could be wrong).
I am making a pricing database that will use a few manual inputs and the rest of the fields will be calculations (gross/profit margin, expenses) based off these inputs. We need to have these calcuated fields stored because they are essential to the pricing decisions and we will have to go back and access these fields at a later time. Another reason for this is because there will be at least one report that will be used to compare prices and calculated fields associated to a certain product by company, program, item type, ect...
Any help would be greatly appreciated.
View 2 Replies
View Related
Mar 17, 2008
I have a table where one field needs to be an autonumber, however, that autonumber needs to be calculated. This field is not based on any other information in the database, but there's a very complicated mathematical process behind it, which I'm figuring out...I just need to know once I get that code complete, how do I tie it into the table?
View 7 Replies
View Related
Apr 18, 2008
I have a form with (3) Text Boxes. Text Box 1 & 2 requires integer input, which is automatically sent/stored in a table. Text Box 3 performs calculations on values in Text Box 1 & 2, but does not automatically update the table.
The following Control Source code is used in Text Box 3 to perform calculation: =([Forms]![Plate Cash]![1-Dollar Bills]*1)+([Forms]![Plate Cash]![5-Dollar Bills]*5)
Thanks in advance.
View 14 Replies
View Related
Apr 26, 2007
Hi all,
I need to figure out how to have two calculated fields written to the database table instead of just being displayed in the form.
The user selects a number from 1 to 5 in the first field, and a number from 1 to 7 in the second field. The first calculating field multiplies these two numbers and displays the result. The second calculating field determines where the resulting number fits in three ranges of numbers and displays the result as Low, Medium, Or High.
My problem is the calculated results are be displayed in the form but not being written to the table. I cannot create a report to display all the High results, etc.
How do I update the calculation field formula to write the results into the table so I can create queries/reports on the calculated data?
Thanks,
bugleboy62
View 3 Replies
View Related
Sep 13, 2013
I've learned the hard way about using calculated fields in a table. I used on while building in Access 2010 for users that will be using Access 2007. Once my testers pointed out the error message, I did some research and realized my calculated field was the problem.
So, I created a query to replicate the calculation, deleted the offending field from the original table and redirected everything to point at the new query vice the original table.
However, my testers are still receiving the error about needing version 14 to access that table. There isn't a calculated field there any longer, but they still can't access that table. Did that calculated field put some sort of taint on my database that can't be removed? I'm not sure what to do. Do I need to start over, so that a calculated field was never part of the database to begin with? If so, how much of my existing one can I reuse?
View 6 Replies
View Related