Hey guys.
This is a real basic question but I am a newbie at this.:confused:
I have created a form in Access that is actually an INVOICE for my company and therefore I have fields like [qty1],[rate1] & [amount1]
In the form in [amount1] I have used the following expression to get automatically generated values.
=[qty1]*[rate1]
This gives me the Amount. But problem is that the result that is automatically generated by this mathematical operation is not stored in my database under the field amount1 and the field is therefore blank. I wish to use this resulted value in a report and also want to use it in other forms e.g. my sales register.
I've been building a CRM in Access that allows for creating profiles for our accounts. When we add a new account, I'd like an Account ID to automatically generate and look like this: CRMXXXXX where the X's represent a random number. I originally wanted to set the field as autonumber to just count up, but unfortunately I need to append this value to another sales database we have; you can't store the text "CRM" with an autonumber in a table.
Right now, all I've done is place an equation in the default value of a textbox I have on my 'Add Account' form. I then made the control source of the text box the Account ID field. My equation is as follows:
="CRM" & CStr(Int(Rnd(Now())*10000))
This appears to work, as it generates a value in the correct format. However, I've realized that each time I open the CRM, the random numbers start over again and I run into issues of trying to create a new record with the same ID as a previously created record. I assume I need to incorporate some sort of timestamp to it in order to change it.
I would also like to automatically attach on the server to this email. Such a file stored such as servernamesharefilename.pdf. Is it possible to do this?
i am new in this forumn i have one access db in which i have one table all Customer having info of no of customer i want to design one form in access which access the record from table customer and also i am able to edit and update the reocrds in form i want to navigate the records as fristrecords,next record,prevoius record, and last record how can i do this pls help me regarding this...
Hi, I wonder if any one could help me with what I think is a simple query.
I would just like to show all the orders thats have been made within the last 7 days.
So far I can retrieve all the orders made today, by using 'Date()' as my criteria, but cant figure out what criteria to use for the last 7 days. It would also be good, if i could figure out how to retrive all orders made within the last month, and as well select all orders made between two specific dates.
Hi, I am in need of help to sort out some records. I have tow existing queries I would like to combine and get one final set of records out of. They go like this:
Query 1. (unique #) Lot Protocol Sample # 1 mth 2 mth 3 mth X ABC 1 x x (check Y ACD 2 x x boxes)
Query 2. (unique #) Lot Protocol Sample # 1 mth 2 mth 3 mth X ABC 1 8/8/05 9/8/05 10/8/05 (query Y ACD 2 8/8/05 9/8/05 10/8/05 performs calculations)
What I am looking to retrive through the third query is this:
Query 3. (unique #) Lot Protocol Sample # 1 mth 2 mth 3 mth X ABC 1 8/8/05 9/8/05 Y ACD 2 8/8/05 10/8/05
Where the third query only shows the calculated dates when the check box is true. So for month 1 & 2 I get dates for Lot X and for Lot Y I get dates for month 1 & 3. I have tried to go through the expression builder, but to no avail. I either get all records, like query 2 or I get nothing reported. I am not sure how to limit the records based on the check boxes.
Quote by Pat Hartman >>>BTW, one somewhat undesirable thing happens when you go with replication. Access changes ALL your autonumbers to random instead of sequential. That means that from that time on, all new autonumbers will be assigned randomly to minimize the problem of conflicts between the design master and replica sets. A random autonumber can range from a very small negative number to a very large positive number. These autonumbers can no longer be used as your customer numbers or order numbers if these numbers are ever printed or given to the customer to be used for reference. A customer probably will be confused by an order number = -2. If this is going to cause you a problem, you'll need to switch to custom generated numbers. Post back for details if you need them.<<<<
I'd be interested in getting some details. Data will be entering that table through a data entry form and through appending from a second copy of the DB. I want to make the PK a random autonumber but then when the second DB is added to the Master DB have the table in the Master DB assign each record a "prettier" more usable id number. I know this is stupid but I'm not sure how to relate code to a table (there's no before update event for a table as far as I'm aware).
I have an orders database using Ac2K. Main tables are: tblOrders: Has OrderID which is autonumber, key index (no duplicates)
tblOrderDetail: Has OrderDetailID --long integer
Tables are related in one to many relationships on OrderID-OrderDetailID with both cascades set.
Database is split with tables and front end on server. I can't put front end on desktops because users can access from any of over 600 computers in the school district even tho there are not all that many simultaneous users.
Data is input on main form bound to tblOrders. When user puts in required information (Date,Vendor other etc.), I save record and autonumber generates a new OrderID. The subform window then opens and user then inputs the details of the order to the tblOrderDetail. There can be multiple entries here.
Form and subform are linked by their ID fields as master-child.
PROBLEM: System which runs on network with 2-3 simultaneous users is unstable. It works for a while (maybe 10-20 orders) and then crashes. The subform window is blank (never opens).
When I examine the tables directly I found these problems:
1) Two of the OrderID's (autonumbers) are the SAME! They are usually right above and below each other and usually tied to the same user altho other order info may be different. I don't see any data "collision" if it's the same user. I thought this was IMPOSSIBLE.
2) There is an entry or two in the tblOrderDetail with ######### in one or more fields. The OrderDetailID field is blank. I once found the ######### in the tblOrders as well.
3) The key index is removed from the OrderID.
4) When I go to the relationships window either the link is missing or the cascade and integrity are no longer active. If I try to re-establish, I get a message about missing key index or unmatched data. If I then go and DELETE the records with the ##########, I can re-establish the relationship. And it works for awhile again.
5. Compact and repair doesn't fix anything.
6. One user "thinks" she saw a quick message about "time-out". Is there some setting in Access that I need to change (Tools-Options-Advanced?)
ANY ideas would be much appreciated. There is nothing worse than trying to work with a system that works most, but not all, of the time.
I'm making a table with a Yes/No choice many fields which represent subscriptions.
The problem is that the subscriptions available will need to be changed fairly often - will this mean the table and the form associated with it need to be redesigned?
If so, I don't know how to make fields that change depending on a different table.
If this can't be done, I'd be interested to find out how else I could go about this.
Hi I have a field on my form called cost of order I also have a field called deposit on the form that is generated by dividing the cost by 2. is there a simple way (most probably) to the send this data to my payment table, I already have a deposit filed set up in the payment table I just want to post the data in from the form?
Is there a way to have access remember a certain time like 2:00 pm and generate a report and send it to a specific person. I know how to make an attachment for sending someone a report but how do I get access to do it on a certain time lets say 2:00 PM?
This is in regards to my same database file posted in my last thread. Basicly it's a work order database. Each task has an employee and the quality of work they did. 1=Bad, 5=Great...so it's from 1-5. I need to create a report of all the tasks which had a quality score of 3 or below for the previous month. I'm good with SQL, but I can't figure out how these Access reports work.
I want my client to be able to double click on the report and have it generate. It would be nice to have it save to a PDF or Word doc, but that would be a plus. Right now I just need to know how to generate reports based on a criteria. I searched the web for 2 hours and could not find anything about this.
I have a log in screen that my users must use before they can use my db. if they enter the wrong username/password they get the usual message boxes. I also thought it would be a nice personal touch if once they've logged in they get a little greeting, so i made a message box that says "Hello " followed by their first name
This did the trick for a while, however theyre sick of seeing "Hello" and want other greetings, i figured this wouldnt be too complicated and took me only about 10 minutes or so to implement.
Basically i created a table (tblGreetings), has two fields, an autonumber field (ID) and a short text field
I've added the following code into the login sequence:
Dim greetings As Integer Dim greet As String Dim randomNum greetings = DCount("ID", "tblGreetings") randomNum= Int((greetings - 1 + 1) * Rnd + 1) greet = DLookup("Greeting", "tblGreetings", "[ID]=" & randomNum)
which in theory should generate a random number between 1 and "greetings" (which is an integer representing the number of greetings ive stored in my table), currently greetings=9
then it should pick a greeting from tblGreetings using the random number as an ID
This more or less works, except whenever the DB is opened and a user logs in, the "random" number is the same every time, it always seems to be 7 (which corresponds to the greeting "G'day").
Why this random number is always the same? it changes if i run the code a few times in the same session, but once the database is closed and reopened it still gives off the number 7, every time
I have the following code (below) that I use to allow the user to select a particular value to determine which records to delete. However, I was wondering if there was a way to avoid having the Microsoft Access auto-generated messages pop up.
For this particular case, after the user selects the value and hits the command button, then a msg box comes up verifying if the user wants to delete the records with selected value. Clicking 'Yes' will then generate the Access message that asks the user again if they want to delete the records and that these actions can not be undone. Clicking Yes here will delete the records.
However, clicking 'No' or x'ing off this Access generated message will then cause a Run-time error 2501. I want to handle this error if it all possible.
Code: Private Sub CmdRemove_Click() Dim strQuery As String DoCmd.Beep If vbYes = MsgBox("Are you sure you want to delete? Clicking 'Yes' will completely remove all prospects with the selected Class from the database", vbYesNo + vbQuestion, "Delete prospects?") Then strQuery = "DELETE * FROM [Prospects] " & "WHERE Prospects.Class = '" & Forms("Classpopup").cmbRemove & "';" DoCmd.RunSQL strQuery End If End Sub
I am developing a DB that is composed of approximately 50 tables. The primary key in every table is automatically generated byAccess. I understand that the primary key for each record in the table has to be unique. My question is: Is the primary key uniqueness applicable across the entire DB?
For example, table A has a auto gen key #25 in it. Therefore, no key in table A can be #25. Now I make an entry in table B (A:B, is 1:many). Can the primary key in table B be #25? OR, once #25 is used and continues to exist, it cannot be used in *any* table?
I have made several small examples and the keys across all the tables are unique. I don't know if this is guranteed across all the db tables, or just in my particular case? Thanks John
I m using autonumber in my ID field.My other table fields are mandatory. There is no problem when I enetered Record completely. Now if I have 20 records. automuber is also 20. Now I want to eneter new record. 21 autonumber generated. But I have not completed the form/table.or I didnt want now that record.So I didnt save it.
But next time I come autonumber 22 is generated for my new record. Now I have 1,2,3,......19,20,22,23....
here 21 has lost.Now is there any option to recover or restict that without completing the full table if the record had not saved autonumber again generated.
I'm trying to make a form where the final user can type in two dates (date range) and the result will generate a report on all activity between those two dates, any ideas ?
Can controls in a form be made flexibly or auto-generated based on parameters set in another form?
Supposed I have a continuous form with 10 textboxes, while at some other time I need to have 12 textboxes or 5 textboxes only. Total textboxes needed would be set from another form. The maximum number of textboxes should be unlimited. Is it possible?
The backend table actually can be created flexibly using SQL based commands. And to link the fields to the textboxes is another problem.
I would like to create a table containing email templates for use around various applications and interfaces. I would also like the user to be able to create the text for these templates, but as well as the dynamic text. So a user might create a record as such:
Email_Template_ID: 1234 Email_Name: "Payment notification" Email_Subject: "Project ID: {Project_ID} - Payment made" Email_Body: "Dear {Title} {Surname} We have recently made a payment of {Amount}. Please check your bank account in the next two days. This relates to Project ID: {Project_ID}, {Project Name}. Best wishes Payment Team"
So a user, with sufficient knowledge of certain field names, would be able to drop in the dynamic content as they deem appropriate. The VBA would then replace anything in curly brackets with the genuine field name.
I could possibly start with Replace(Email_Body, "{", "' & [") and repeat it for the end curly bracket, but I'm sure VBA would just render this as Dear ' & [Title] & ' etc. without interpreting it as Dear Mr...
I hope I've explained myself OK. To look at it another way, in Excel there is a function called INDIRECT() which allows Excel to interpret a cell reference as the actual content of the cell...
I have created a form taking in Data from a query.On the form I have created a combo box. The selected value is used in an criteria of the query.The criteria in the query is:[Forms].[frmMyPortfolio]![cbodep].How can I ensure that all values in query are generated, if their is no selection in the combos.
I use this bit of code to generate an Outlook email body with the contents of strBody. How can I modify this so the HTML generated is in "Courier new" font size 11?
With MailOutLook .To = Recipient .CC = RecipientCopy .Subject = Subject .BodyFormat = olFormatHTML .Body = StrBody .display End With
Good Evening Everybody, I am currently helping some people out at work with their database. My knowledge of Access is very limited, and whilst my it is improving I have nonetheless come up against a ‘hurdle’ which I am struggling to jump. The database in question is not complex, quite the opposite in fact. Basically 1 table ‘Main Data’ , 1 data entry form and a few reports. The table includes 8 fields in the following formats:
ID: Auto Number Area: Text Equipment:Text EquipSrlNo:Text EquipLocalNo:Text MOPNo:Number DateDone:Date/Time MOPPeriodicity:Text
I was recently asked to produce a report for them that would search between two dates using a parameter query and to then return the result. The problem is that when I generate it using the following SQL it returns records in the period that I asked for, but then collects ‘additional records’ which fall outside the date-span that I originally requested, i.e. search Between 03/04/08 And 30/04/08 produces data that relates to data in May, June, July 08 etc. I thought that what I was doing was correct, and it has worked for me in the past- but on this occasion I am absolutely confused???
SQL SELECT [Main Data].Area, [Main Data].Equipment, [Main Data].EquipLocalNo, [Main Data].MOPNo, [Main Data].DateDone, [Main Data].EquipSrlNo, IIf([MOPPeriodicity]="1",DateAdd("m",1,[DateDone]),IIf([MOPPeriodicity]="3",DateAdd("m",3,[DateDone]),IIf([MOPPeriodicity]="6",DateAdd("m",6,[DateDone]),IIf([MOPPeriodicity]="WEEKLY",DateAdd("ww",1,[DateDone]))))) AS TestDueNext, [Main Data].MOPPeriodicity FROM [Main Data] WHERE ((([Main Data].Area)=[Enter Area Type]) AND ((IIf([MOPPeriodicity]="1",DateAdd("m",1,[DateDone]),IIf([MOPPeriodicity]="3",DateAdd("m",3,[DateDone]),IIf([MOPPeriodicity]="6",DateAdd("m",6,[DateDone]),IIf([MOPPeriodicity]="WEEKLY",DateAdd("ww",1,[DateDone])))))) Between [Enter Date Start] And [Enter DateStop]));
Unfortunately, I do not have a copy of the database in question and so I am unable to post it for the purpose of explanation.
Can some kind person point me in the right direction as I am slowly losing the ‘will to live’ Ha? Ha? You have always been so helpful in the past and hence the reason I have called upon my ‘forum friends’ to help me out?
I have an access table stored with information of different people. Each person has his own personID. To print that information i need 1 page per person. So I made a report grouped based on the PersonID and inserted a pagebreak after that section. It worked perfectly untill I needed to customize the layout of each page based on other information of the table.
For example; I want the textboxs for person1 on the form to be put closer to each other than for person 2. I use VBA to control the layout of the report which worked perfectly, but i dont know how to control the layout with VBA for each specific page.
I need a Query that grabs the lastest "newest" data from the 5 tag.table tags generated from the query below and Display them in a result,
SELECT FloatTable.DateAndTime, FloatTable.TagIndex AS FloatTable_TagIndex, FloatTable.Val, TagTable.TagName, TagTable.TagIndex AS TagTable_TagIndex FROM FloatTable INNER JOIN TagTable ON FloatTable.[TagIndex] = TagTable.[TagIndex];