I have a table which has a primary key of 3 fields. Each individual fields is defined with duplicates OK but I want to block a record being added where the primary key value exists already. How can this be done - the way I have set up the database Access does not automatically stop this as I thought it might. Do I need somw vb also??
hi, i have a form which shows all of the transaction that have happened in the business, a field in the form is 'logged by'. The 'logged by' field records the name of the person who completed the transaction. For monitoring the employees performance i have created a query which shows all of the transactions each employee has done, ie there is a promt for the users name to be typed in, then all there transactions are brought up. I now want to produce a report off this, but with the total of transactions the particular employee has done at the top of each page of the report. Basically i want the value it says in the record selectors at the bottom of the record, the total number of each employees transactions. I have tried doing a calculation in the query, adding the amount of auto numbers up, but that doesnt work. Not really sure where i should start from..any tips? :confused:
My update function does not always work properly, especially when one of the fields is 0 or blank.How could i improve my function so that when addding wih 0 not to give 0 ?
My function is the following: Public Function dummy() StrSQL = " UPDATE (products1 INNER JOIN products ON products1.Productid = products.Productid) INNER JOIN [Order Details1] ON " & _ " products1.Productid = [Order Details1].productid SET products1.items1 = [order details1].[quantity]+[products1].[items1]" End Function
Hi all, I have a table with the number of existing staff per department separated by their corporate level. I am able to use a query to display the number of staff per month(Mth1=ExistingStaff..so on).
Since there will be staff changes such as promotions or new staff additions, I need to cater for that. Thus, I created separate tables for each case.(tblNewStaff & tblReclassStaff) The idea is to use a form to allow the users to choose which staff to promote (reclassification in corporate level)where the user just has to specify which month the change is in. A separate form is used to add new staff.
However, I am having problems trying to figure out how to make changes to the Number of Staff per month after such changes. New staff are added as new records while reclassifications will alter the current numbers. Both has been dogging me.
Is there a way to dynamically generate this through a query? Or is there a better way to go about doing this? The numbers collected will be used to calculate incremental salary etc...
Thanks for any help! My brain is fried after trying to solve this problem the past two days...
Hey everyone, I have a form that acts as a survey asking 11 questions total. Each field in my table is called material1, material2, ect. I have a total field in my table that I would like to be the sum and was told that I have to do this through a query. My only problem is when i query it only gives me the sum of Question 1, 2 ect and does total them all. Can someone nudge me in the right direction as I am relatively new to this. i appreciate everyones help on this forum.
I have a query which returns selected rows from my table, one of the columns in the table is price.
I want to total the price into a text box on the form and run the query in the 'on current' event of the form so it recalculates depending on the record
Hey guys, I'm trying to set up a small inventory database. On my form i want the user to be able to add and subtract from the item amount by typing in the text box a number, if the number is positive then i want it to add it to the table's existing number, if the number is negative then i want it to reduce my existing number. The number in the table will be contained in a different text box on the form. I'm sure i need to do some sort of expression builder, preferably upon enter. and i'm not sure if the form would need to refresh for the number to update? Could any of you guide me to the correct path? Thanks in advance -John
PS oh after it updates i would like it to clear the text box and then redirect focus to a different box but i think that is just basic coding
I have records that go by name(cfr_Name) with a charge amount(cfr_charge). Now the charge can have up to 5 diiferent charges per name. Most likely it will be the same charge 5 times. i dont want access to add the 5 charge amounts i want it to dispaly one value. So if it is 20.00 display 20.00. But if the person appears again with 5 records and a charge of 30.00 i want it to display the persons name and 50.00? so i am adding only two values not 10. If the charge field has a value of 20.00 for 5 records the vaule is 20.00. so if one set of 5 records has a value of 20.00 and another set has 30.00 the total in query would be 50.00
I want to have a dropdown box in a form but allow additions to be made, but after they are made, instead of them not showing up in the box like usual, I want them to become a part of the list. Plz help! Thanks
I am a self taught beginner in Access applications, so excuse my lack of expertise and terminology. From reading through this forum, I realize how far I have to go. I am not a techy by any means.
My question: I have a database that keeps track of the delinquent taxes for our Town. One of the reports is set up from 2 queries, then 2 related tables (beginning balances and payments made). The query calculates the balance of each account based on the beginning balance minus the payments made, and returns a report which shows each account balance, and then another query returns a report showing the total balance of all the accounts due for the date the report is generated.
I am wondering if there is a way to generate the balances due on a previous date. For example today is July 13, and I want to know what the balances were on July 1. Both tables have a date field- beginning balance has a start date, and the payments table has the dates of any payments.
Hi all,i am running a query that (as part of it) returns a total time.. using a formula i found on this site. this formula uses a start and end time and works wonders. works!IIf([StartTime]<[EndTime],DateDiff("n",[StartTime],[EndTime]),1440-DateDiff("n",[EndTime],[StartTime]))/60my problem however is an option that i need my users to have to enter a time not based on a start end time, but a "OtherTime" if u will. (ie they have 4 hours instead of writeing 1:00 - 5:00) already changed this from default value null to 0... (which i didnt wanna have to do cuz it messes up the query)Doesnt Work(IIf([StartTime]<[EndTime],DateDiff("n",[StartTime],[EndTime]),1440-DateDiff("n",[EndTime],[StartTime]))/60)+[OtherTime]i want the total time in the query to show the 4 hours, but it is leaving it blank. i am guessing that it is because my start end times are blank(null) is there a way to add a if statement into a query expression that will bypass this? Tried, but thats invalid in a query expressionTotalTime: If IsNull [StartTime] Then =[OtherTime]Else IIf([StartTime]<[EndTime],DateDiff("n",[StartTime],[EndTime]),1440-DateDiff("n",[EndTime],[StartTime]))/60+[OtherTime] end if
and so on and so forth to the point it would add all the fields up into a grand total.
The only problem I run into is it won't add them up unless there is at least a value of $0.00 in the field. Which makes it look VERY cluttered since on average only 1/3 of the forum will be used regularly.
Is there any way to make it show the grand total even if a field is blank?
What is the condition or how should I write a VB code to block the command go to last empty record? I have a form which has three buttons : Go to Previous Record, Go to Next Record and Add New Record. If I add a new record, and I press "Go to Next Record" well, it goes to the next empty record this means it does the same job as the "Go to Add New Record" button. How can I stop this happen?
I hope someone can help me. I have a report that prints out with the customers social security number on it. I need to change it so that only the last four digits of the SSN show, so it would like something like this XXX-XX-1234. I still want it to keep the full SSN in my Table though so we can search for the customers info with the SSN.
Is there a way that I can change it on the report only and not mess up any other forms that I have it on? Any help would be awesome!
I have a form for all my clients, and currently there's a separate field for each part of the address. This does not make it easy to cut and paste an entire address block. I therefore created an unbound text box with the control source as:
This works ok, but if someone doesn't have anything in the fields [Pref1] or [Pref2] it leaves blank lines. Is there a way to code it so that I can have a complete address block? Thank you.
I am new to MS Access, and I am wondering if there is a way for Access to automatically send an email to a defined address everytime a record is added to a specific table? I have created an escalated issue table and I would need an employees manager to be notified automatically when a new record has been added to it.
Hi all, i have a table called expense that i have tied to a case table... i also want this tied to the employee table, but when i add the employeeID field to the expense table it messes up all my queries that i had previously created... the queries merely reference the expense amount that is located within the expense table... is there something that i am doing wrong? (obviously there is) but i would like to know why this is happening
I have a split design form, where user can select on any row and column of the spreadsheet view of the form and edit the data. Now, I want to write a code to limit the data addition(Row addition) to a certain number. But I still want to be able to edit the previous records added to the form.
I used Me.AllowAdditions = False, but when I want to select the previous records, it gives error:"You cannot go to specified record".
I need to export a table as a text file but using the outputto or transfer text options do not produce the file format I want. If I export the file as Excel and then save it as text it's OK so I copied the following code to automate the procedure but get an error 'Object variable or With block variable not set.
I have the below code that seemed to work until I tried to add the Loop to it. Now, every time it gets to the piece of the loop with the words Cells.Find, I get an error stating "With Block or Variable not set". I don't understand what the problem is. There is no "With Block" and the variable is set. How can I get this to work?
Code: Function ClearColumns(xlWS As Object, ColumnRangeToClear As String) xlWS.Range(ColumnRangeToClear).ClearContents End Function Public Function SendTQ2XLWbSheet(strTQName As String, strSheetName As String, Col As Integer, strFilePath As String, FirstCellStr As String)