Access 2003. I am trying to save a calculated field (Item No) from a form to the accosiated field within the Products table
I have a hidden text box (itemNo) which is bound to the relevant field and a second text box with the following formula
="TV-" & Left(CatShort.column(1),3) & "-" & Format([ProductID],"0000") as its source
What I am trying to do is to provide an item number for each item of stock based on the Category short name (Catshort) and the incremented item ID Number, with a TV prefix.
I am aware that its a bad itea to place calculated field into the table if the calculation is likely to change, however once my calculation is stored it has no need to change.
I have tried the beforeUpdate method within the ItemNo textbox
Private Sub ItemNo_BeforeUpdate(Cancel As Integer)
Me!ItemNo = Me!ItemCalc
End Sub
but nothing happens (in that the table is not updated)
Any way of putting together an incremental item number based on the selected category with a "TV" prefix....
Having some problems with a calculated field on a form. The field came from my table but I typed in the calculation (=[cost_price]+[sale_price]) and it works fine but it wont save to my table so when I run a repot off it doesnt have any of the calculated values because they arent saved in my table??? Can anyone help?
Hi I'm creating a small stock control system. I want to be able to update stock levels. Simply by entering new amounts of stock when they arrive and adjusting for stock used that day. I've created a form from a query which takes current_stock level and then I enter a value (say 50) and it is calculated (added together). Then i want to save that new value back into the current_stock field? Can anyone help??
I have the calculation =DateDiff("yyyy",[DOB],Now()) in the Data/Control source properties of a numeric field in a database/form which correctly calculates age in years from a date field DOB. How do I get this field to save to the database? Georgina
I want to be but to save a space in a field on a table but every time I do it appears to be a NULL and therefore fails a validation rule that I wish to preserve.
I am trying to create a saved export on a table i have. However i want to filter so when i do the saved export it exports the table with the filtered result only.However when i filter my table and export it and save the export. The first export comes out with the filtered results but when i go to my list of saved exports and export it again, it doesnt come filtered and its just an export of the whole table.
I have a [DOB] field with birth dates. I have another field [DOBExp] where I want to automatically calculate at date 15 days out, but exclude weekends and holidays. I have a separate table listing the holidays.
Would like a formula to use in my first table for this. Have no clue how to do this.
I shouldn't normally record calculated figures into my table. I'm willing to buck proper procedure here for ease of use for referencing in reports; also, it's just one data point that will be calculated only once and not changed.Anyhow, I have an IIF statement that calculates a total price based on a table of costs. I set this as the default value and it calculated properly - but once I set my text box to have a control source, it no longer calculates my cost.
I was hoping to set it so it calculated the cost and then write that total cost to my table.should mention that my calculated control is in a subform.
I need a Select Query to display data on a form. When an order is appended to my table the field named Printed is updated with the time it was appended. When my form opens it needs to display the field Printed and a field I call MinutesFromPrint. This field needs to display the total minutes elapsed from the time in the Printed field to the current time. My expression is not working.
MinutesFromPrint: DateDiff("n",[Printed],Now())
Here are a couple of samples of my results when I run the query at 7:49 A.M.:
What I have is a database setup with multiple tables in which different areas of my DC can input information simultaneously into their respective tables. I then have another database linked to it for myself to have a live view of each updated record. I would like to see all the records of each table in 1 single table (possibly just sorted ascending by time). Each table has the same Field headings but may have different qtys of records. As I will then have it linked to an Excel table to VLOOKUP from it.
I have tried Union coding but always get Syntax Error etc.
Hi, I have been tasked to create a database that will be accessed through a dial-up connection to our server. What I want to know is which is faster 1 Using a seperate table for dropdowns or 2 Using the lookup facility of a table. cheers
I have a scheduling database that requires keeping track of events on a 24 hour basis. I need to keep track of all the events through out the day by date and time. I want the user to only have to enter the time instead of entering a date and time. What is the best way to allow the user to enter only a time, but when the time is saved to the database, it’s saved as a date and time using the current date? I’ve tried using the date add function but that doesn’t work. Does anybody have any ideas.
I'm a beginner, and i want to know how to calculate time difference. For ex, if i substract 23:45 of 02/09/2006 with 00:10 of 02/10/2006 then i get a - "ive" value... Please somebody help me with a vba code for this...
Can someone please help me as this is driving me crazy and I know the answer must be simple.
I have a query/report that shows the duration a call has taken i.e. it times each part of the call. For example it may take a member of staff 00:00:30 to answer a call, then he puts a customer on hold whilst he speaks to another department which could be another 30 seconds, and then he ends the call with the customer.
So my report and query shows:
Ringing 00:00:30 Speaking to customer 00:04:10 On hold 00:00:30 Ends call with customer 00:02:00
The duration of the action is in a seperate column. How do I tell access to add these up so I get a total of 00:07:10 for the entire call from start to finish?
I am struggling with a filter I thought would be simple. I have a field called close time and I want a filter that will show a record one hour before the close time?
Box 1 contains an employee's total weekly hours in hours and minutes: 40:00 Box 2 contains the actual total hours worked for the week: 35:30 Box 3 is the difference between Box 1 minus Box 2
I tried all the date/time functions to calculate the difference between Box 1 and Box 2 and none of them worked. I keep on getting an error message. Does anybody know how to calculate the difference between two sets of time (in hours and minutes)?
I'm having trouble getting my head around this. I have a database that collects stats of patients admitted to ICU. I have a table PtDataTable (pk = PtID) with a one to many relationship with PtVisitTable (pk = VisitID, fk = PtID). The patient visit table has the fields AdmissionDate and AdmissionTime, and DischargeDate and DischargeTime. I need to calculate if the patient is readmitted to ICU in less than or equal to 48hrs. In other words calculate the time elapsed between DischargedDate and DischargedTime in one record and the AdmissionDate and AdmissionTime for other records in the PtVisitTable for the same patient. I'm not sure if I stated this clearly. Any help is appreciated as always.
Hi. I'am trying to count: todays date -12 month. So how I tell access that I want answer which date is year from this date? Or how I must "write" 12 months in SQL?
Table ------ I have one field called [Time] in dd-mm-yyyy hh:mm format in table A.
I have another field called [Deadline] in text format (Mon 10:00) in table B.
Queries ------- Need to build one queries that have the above two field, but with additional field called [PullDeadline] that the [Time] will look out the [Deadline] and return the actual time & date value in [PullDeadline]. No matter how the [Time] change, the [PullDeadline] will stick to [Deadline] and return the value in that particular week.
For example,
[Time] = 01-12-2007 05:00:00 AM [Deadline] = Mon 10:00 [PullDeadline] = 26-11-2007 10:00 AM
How to handle, if the deadline is previous or next week?
Eg. [Deadline] = Sun 10:00
Then [PullDeadline] = 25-11-2007 10:00 AM instead of 02-12-2007 10:00 AM.