Pulling My Hair Out! Hope I Can Explain
Jul 16, 2005
Let see if I can explain my goal. I've been fighting with this for some time with no resolve. In the included DB has a table that represents the fields that will be queried in the real DB. It shows records of one of many employees that were "tested" (shopped) on a date and whether it was a successfull shop or not. My goal is in three parts.
1)A query that goes through each employee and returns the records with the check box in SuccessYes checked (Yes) back to the last unchecked box, not including the unchecked box. In the example given the last (most recent) 5 records would be returned. If the shop of date 1/18/2005 was not checked, it would only return the last 2 records. Basically, I'm looking for a way to have a report that shows everyone's current successes in a row. It could be any number.
2)A query very similar but it returns only those employees that have the current successes in a row totalling 5 and where the field "Award5_Paid" is NOT checked (they have not been paid their reward). From there it should be easy to do one for the 10 in a row.
3)If I've got a form open (or...?) where I can place a command button, that when clicked, it appends the selected records with checks in the appropriate boxes for being paid. Example: If a set of employees come up in the query with 5 successfull shops in a row because the "Award5_Paid" field is unchecked, then I need to pay them. Click the button and the Award5_Paid field gets checked in THOSE RECORDS ONLY so that the next time I run the query, they won't show up and get paid twice. Issue? What's the coding or SQL or ??? that's run when clicked.
I hope that makes sense. I've been running around in circle trying to figure this one out. Maybe it can't be done, but if it can, I know some of you know how.
As always, thanks for the assistance.
-Jim
View Replies
ADVERTISEMENT
Dec 28, 2006
I have created several Queries and I would like to have a column that numbered the results. I have looked all over saw a couple of samples but havent had any luck. Anyone have any suggestions. Thanks for your help and have a good New Year.
Just to clarify basically this is what I need. Loan Number is the Primary key.
# Column Borrower Loan Number
1 smith 123456
2 jones 023567
3 jang 102569
JW
View 2 Replies
View Related
Feb 6, 2008
I'm certainly not new to Access, but this is the first time encountering a problem like this. I have a table with 3 Field Names, [Return], [Header] and [Date]. An example table looks like so..
Return Header Date
1 | 10 | 1/1/2007
2 | 10 | 3/1/2007
3 | 10 | 5/1/2007
13 | 20 | 6/1/2007
14 | 20 | 7/1/2007
I need to take to have group the Header's together, for instance 10, and have it return the [Date] for whichever line has the lowest [Return] value. I just can't figure out how to do it. Any help or insight would be GREATLY appreciated. I'm 90% done with the project, and this last part will seal the deal.
View 3 Replies
View Related
Feb 24, 2005
I have a database from which users e-mail country specific reports to a group of receipients.
I am currently using the following code:
DoCmd.SendObject acReport, "Report UK", "SnapshotFormat (*.snp)", "rec1@company.co.uk;rec2@company.co.uk;rec3@company .co.uk", "", "", "Report UK", "See attached document", False, ""
Everytime when a receipient needs to be changed or added the users ask me and I have to change this code; this is offcourse not the best way. For some countries I even have as much as 15 recepients
What I would like to do is set up a table showing for each country the e-mailreceipients, link this to my form and use the field from the form in my code which is activated by a click on a button.
So I started testing this, but I am really breaking my head on this one....
I found two other examples on e-mail from which I took some code and sort of got something working.
The problem that I have now (see attached database) is that even though there are e-mailaddresses in the field on the form the code considers the field empty (null) only after clicking on the field the script works.
My idea however was to make this field a hidden field - users should no be bothered about this
Anybody have an ide how I can overcome my problem?????
View 2 Replies
View Related
Sep 22, 2007
I have a data source table with names, addresses and UK postcodes, and another table that has partial postcodes (the bit before the space) and I need to look up the local authority for each postcode. I created a front end that links to both tables and tried converting the full postcode in one table to the first 4 characters and the partial postcode in the other table to the first 4 characters too, using two separate queries, both of which give the right results. Then I used a third query based on both of the above to match up the records from both queries, but I get a "Data type mismatch in criteria expression" error. I am just using queries on tables because I'm not very au fait with VBA and so on. Any ideas, anyone please? (I can happily email all to anyone who wants to look.)
View 4 Replies
View Related
Mar 3, 2005
Hi All.
Before I start, I have read other posts on relationship, but none that can answer this, so if it does, maybe someone can point me in the right direction.
I have put together database's before, but just with parent to child relationships. I need a db to go further.....and have been trying for about a week, just going round in circles!!
e.g.
I have the following tables...
tblProject
tblBuilding
tblFloor
tblroom.
I can create it so there are many buildings in each project, that is OK. I need it so there can be many floors under each of the buildings, and many rooms undereach of the floors etc etc etc.
Also, need a Unique_ID for every record of building, floor, room.
I will need in the end to run a report on a room, which will tell me the floor, building, project it is in etc.
I cannot work out the relationship's between each table and, I know I can insert a subform into a form which will link tblProject to tblBuilding, but how do I add tblFloor to that link?
I do hope this makes sense, and I have attached a db which may help explain
Many thanks in advance.
Frank.
View 1 Replies
View Related
Feb 6, 2006
Hi,
I have a split database. The front end with forms etc is distributed to users and the back end with tables sits on a shared drive.
I have been trying to set the security on this and quite frankly it's driving me mad. I managed to get the security set with 5 user groups and about 100 users - it all worked well on my PC but when I distributed it, the copies open with the Admin as user, no password required, resulting in no security whatsoever.
Further reading showed me that I had to change the owner of all objects from Admin to a new adminitrator, who I named Custodian1. This I did. I then created a new database while logged on as Custodian1. So, the new database has all objects owned by Custodian1 and the database itself is owned by Custodian1.
The book said I had to delete the Admin user but, after asking if I was sure that I wanted to delete the user, Access would not let me.
I went through the Workgroup security wizzard a number of times to try to reset things that way, all to no avail. I then did the whole ownership change thing with the back end database and relaunched the wizzard. Still unable to delete the Admin user.
My final attempt was to use the wizzard and create a new WIF rater than edit the existing file. And still, I cannot delete the Admin user and distributed copies have no security.
I don't know how this ties in, but the distributed copies do not seem to be linked to the WIF although they find the Back End database, in the same shared drive/directory with no problems. If I set a password on a distributed FE database copy, it then cannot be opened as the users are not defined.
I'm obviously missing something fundamental to the whole process. A further difficulty is that I have the live database FE/BE, working copies FE/BE, The security wizzard backups FE/BA, and all the directories have similar names. On top of that, I have my normal none database duties to distract me. I'm finding it very hard to keep track of where I am or what I am doing.
Any help most gratefully appreciated and received.
Regards,
Keith.
View 14 Replies
View Related
Aug 24, 2007
I am building a database that will tell the company what items to dispatch to the customer first. It’s a food company. So getting products out on time is important. I will try explain it. Say the food company makes a batch of 30 apple tarts. This collection of products has a set batch number with all the relevant information attached. For exampleBatch no 4457 - qty 30 - created 10/10/07 - use by 10/11/07 Batch no 4458 - qty 30 - created 11/10/07 - use by 11/11/07Now lets say customer (joe Bloggs) orders 35 apple tartsThe food company wants to take all the first batch (4457) and 5 from the second batch (4458) The will have an order sheet with the followingApple tart batch 4457 - 30Apple tart batch 4458 - 5 After the order is gathered it will be given an order number of say order 8897The company can now go back and look at order 8897 and see what was shipped in that order and what the batch numbers where for all products. Any help would be greatly appreciatedAlan
View 14 Replies
View Related
Dec 12, 2007
I have a database the keeps tracks of printers by serial number. There is a form for doing this, the form has a serial number field, and a status field "example move, add, remove" , effective date and a location field. Here is what I want to do, lets say that the current location for serial#ABC is in location C and then the user opens the form and tries to move serial #ABC to locaiton C, how can i display a message saying that Serial#ABC is already at location C, maybe I can do this by a DLookup or by a record set, but the only thing that i'm struggling with is how do I make it look at the latest record by the effective date. Thanks.
View 6 Replies
View Related
Jun 18, 2006
Hi Guys,
The asset managment system I have been developing is due to go live next week and I am really struggling with the data entry and search forms.
I have attached a picture of the main form (and outlined each subform) to give you an idea of my project.
The attached form is actually a Main Equipment Type Detail form with a child subform AssetMain which has a number of child subforms i.e. Asset Details, Purchase Details etc.
When a user clicks to add a new asset a popup form asks them to select an equipment type i.e. PC. When they click it opens the attached form. Their selection filters the equipment type detail values in the combo i.e. Laptop, Tower, Server etc.
When a value is then selected in the combo you can then add an asset for that equipment type detail. (One Equip Type > Many Equip Type Detail > Many Assets)
1st Problem)
I have set the Asset Main subform to allow additions only. When the whole form opens, the Equipment Type combo (at the top) does not display a value but does actually contain the first value.
How do I force my user's to select a value in the combo before it actually filters the child subform?
2nd Problem) The Asset Main Subform (filtered by selected Equip Type) should only be used for data entry. I set the data entry property of the form to True but when the value in the Equip type combo changes, it displays all the relating records in the subform. My only solution so far is to stick
Subform.DataEntry = True
in the Equip Type combo's after update event. However, this doesnt look to good as it flashes up with the data and then displays a blank record.
Any ideas?
3rd problem) Due to the fact that I am using a number of subforms, my tab order is such that values are entered for the main form (i.e. ID, Condition) then subforms (i.e. manufacturer) then back to the main form (i.e. allocated to). This means that:
a) I am having problems validating the record beforeinsert as I have had to change the required property to "no"
b) Once the user has tabbed through all the forms what is the best way to go to a new record? Alternatively if I add a new record button I need to check that the necessary fields have been filled in (on all of the forms/subforms).
and finally the 4th)
I have a search form that queries the assets. The search results are displayed in a list box. When you dblclick the list box I need to show the asset details.
Question: Can I use the above form to do this? My only problem is that I need to open the AssetMain form which is a sub form in the above. If I try and use the existing form it will not open as many of the controls refer to the form as a subform. Do you think I need to create a separate form for showing the data to entering it?
Would really appreciate some help (not that you havent heard that before :) )
My head is going to pop in a minute!!!
Thanks
Ben
View 5 Replies
View Related
Apr 6, 2007
Can someone explain what the following code does.Thanks in advance
Set dbUser = DBEngine.Workspaces(0).Databases(0)
Set rsUser = dbUser.OpenRecordset("SELECT User.UserName FROM [User]WHERE (((User.UserName)='" + txtUserName + "'))")
View 1 Replies
View Related
Oct 17, 2006
Hi all,
I was recently asked to rewrite some stuff and i was wondering if the query below can be expressed with just ( SELECT, FROM, WHERE, GROUP BY ) Instead of JOIN.
Someone else wrote the query below and Joins always confuse me ...
Thanks in advance
SELECT Grpoffic.CODE, Evoter.precinct, Evoter.grp, IIf(evoter.style Is Not Null,evoter.style,evoter.[activator code]) AS ballot, Evoter.party, Evoter.[date voted] AS [voted date], Evoter.certnum AS [voter id], Evoter.name, Evoter.address, Evoter.[ev location] AS [Location voted], Vote_status.status, AB_CODE_reason.reason AS [absentee reason]
FROM Vote_status, AB_CODE_reason RIGHT JOIN (Evoter INNER JOIN Grpoffic ON (Evoter.precinct = Grpoffic.pct) AND (Evoter.grp = Grpoffic.grp)) ON AB_CODE_reason.code = Evoter.reason
ORDER BY Grpoffic.CODE, Evoter.precinct, Evoter.grp, Evoter.name;
View 1 Replies
View Related
Mar 6, 2008
Month Number: Mid([Date],4,2)
I also have the SQL that goes with the query:
SELECT Mid([Date],4,2) AS [Month Number], Count(tblOrders.Order_Number) AS CountOfOrders, Sum(tblBikes.Price) AS SumOfPrice, Format([Date],"mmmm") AS [Month Name]
FROM tblOrders INNER JOIN (tblBikes INNER JOIN [Order/Product] ON tblBikes.Model_Number = [Order/Product].Model_Number) ON tblOrders.Order_Number = [Order/Product].Order_Number
GROUP BY Mid([Date],4,2), Format([Date],"mmmm");
:confused:
View 6 Replies
View Related
Aug 11, 2005
Hi expert. could any one explain this code for me. I do not understand some parts of it. I know the output but not some parts of the code.Thanks
Code:Private Sub processButton_Click() Dim fso As New Scripting.FileSystemObject <------ Dim io As Scripting.TextStream <------ Dim db As DAO.Database Dim rst As DAO.Recordset Dim fld As DAO.Field '''Declreaing our variables Dim strBase As String Dim strInsert As String Dim strFields As String Dim strValues As String Dim strTemp As String Dim strFile As String Dim strName As String Set db = CurrentDb() Set rst = db.OpenRecordset(Me![ComboBox]) strBase = "INSERT INTO " & Me![ComboBox] & "({%1}) VALUES ({%2})" <------ strName = "c:" & Me!ComboBox & " Data.sql" With rst <------ While Not .EOF strValues = "" <------ If Len(strFields) = 0 Then For Each fld In .Fields If Len(strFields) > 0 Then strFields = strFields & "," & fld.Name & "" Else '''strFields = "[" & fld.Name & "]" strFields = "" & fld.Name & "" End If Next fld strInsert = Replace(strBase, "{%1}", strFields) End If For Each fld In .Fields If Len(strValues) > 0 Then strValues = strValues & "," End If If IsNull(fld.Value) Then strValues = strValues & "null" Else v = fld.Value Select Case fld.Type Case dbMemo, dbText, dbChar strValues = strValues & "'" & v & "'" Case dbDate strValues = strValues & "#" & v & "#" Case Else strValues = strValues & v End Select End If Next fld strTemp = Replace(strInsert, "{%2}", strValues) strFile = strFile & strTemp & vbNewLine .MoveNext Wend rst.Close End With If Len(strFile) > 0 Then Set io = fso.CreateTextFile(strName) io.Write strFile io.Close End If End Sub
View 3 Replies
View Related
Oct 11, 2006
I am trying to figure out how this code actually works. In the Field I see the following code:
IIf(Weekday([CollectionDate]-4)=1,[CollectionDate]-6,IIf(Weekday([CollectionDate]-4)=7,[CollectionDate]-5,[CollectionDate]-4))
In the Criteria I see: Like Date()
I know what the "LIke Date() does but what im trying to figure out what is the connection to the above....
Any Help would be greatly greatly appreciated!
View 1 Replies
View Related
May 10, 2006
:eek:
--------------------------------------------------------------------------------
I have made a reasonably simple database, for some reason I am struggling to send of reports by Emails.
The piece of code I am using is:
Private Sub cmdEMailRptPastNonCon_Click()
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmSwitchboard", acNormal
On Error GoTo Err_cmdEMailRptPastNonCon_Click
Dim stDocName As String
stDocName = "rptPastNonCon"
DoCmd.SendObject acReport, stDocName
Exit_cmdEMailRptPastNonCon_Click:
Exit Sub
Err_cmdEMailRptPastNonCon_Click:
MsgBox Err.Description
Resume Exit_cmdEMailRptPastNonCon_Click
End Sub
A box appears with the options [rich text,html,snapshot etc] I choose an option and a message box appears saying: "The database engine could not lock "tblMain" because it is already in use by another person or process., I know this is probably a simple stupid error ive made but being a complete beginner I am stuck, any ideas of where I should look to find any errors?
Thanks for any help recieved.
Mat
View 3 Replies
View Related
Mar 29, 2008
Hi all!, i would really appriciate it if you could help me out. I have this complex query... in one table i have dates and costs associated that show when fuel was put into the system
such as:
1/1/2008 -- $200
1/20/2008 - $100
1/25/2008 - $150
I then have another table that has data when fuel was taken out of the system
such as:
1/2/2008 -- ($50)
1/3/2008 -- ($20)
1/4/2008 -- ($10)
what i need is a query that is able to show a running tab on the fuel tank and how much fuel is in it...
so for example if it could spit out a result such as
1/1/2008 -- $200
1/2/2008 -- $150
1/3/2008 -- $130
1/4/2008 -- $120
If this is convoluted i can upload a little database..
Thanks! (Here is the current query i am using but its not working right.
SELECT DatePart("yyyy",[purchase_Date]) AS AYear, DatePart("m",[Purchase_Date]) AS AMonth, DatePart("d",[Purchase_Date]) AS ADay, DSum("gallons_purchased","purchase_fuel_tbl","DatePart('d', [purchase_Date])<=" & [ADay] & " And DatePart('m',
[purchase_Date])<=" & [AMonth] & " And DatePart('yyyy',
[purchase_Date])<=" & [AYear] & "") AS RunTot, fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons, [RunTot]-[fuel_use_tbl].[gallons] AS cur_Value
FROM (tank_tbl RIGHT JOIN purchase_fuel_tbl ON tank_tbl.tank_ID = purchase_fuel_tbl.tank_ID) LEFT JOIN fuel_use_tbl ON tank_tbl.tank_ID = fuel_use_tbl.tank_ID
GROUP BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]), fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons
ORDER BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]);
View 14 Replies
View Related
Dec 15, 2005
Could someone tell me how to change the border colors on a form. There are lots of posts on changing txt border colors and such but i want to change the form border its self.
View 5 Replies
View Related
Sep 6, 2006
I have a form that I has a password field that matches the employee name. I want the employee to enter in a data field their password. If it matches I want another field (verified) (yes/no field) be marked as yes if it matches and no if does not.
I did IFF([Text5]=[Password],[Verified],= -1, [Verified]=0]
But it didn't work. Any suggestions.
Thanks for the help
View 1 Replies
View Related
Aug 17, 2006
I know how to do this and I think it is simple I just cant remember right now. I have a field in a query called LastActivation. I also have another field called DateEntered. In the query I want to have LastActivation=DateEntered. How do I do this?
View 6 Replies
View Related
Sep 5, 2006
I saw this code and was wondering how does it actually work?
I saw it in/connected to a textbox.
Private Sub savetime_BeforeUpdate(Cancel As Integer)
End Sub
View 1 Replies
View Related
Jan 24, 2008
Hi there. I created some forms using the wizard. But I set up the properties on my form so that the navigation bars don't appear. I only want them to be able to input new records. I also added code on the form_open event to default to adding a new record. But I noticed that if i use my scroll wheel on my mouse, I can still view previous records. How do i prevent any previously saved records from loading?
Also, where do I add a message box to say that the data has been saved? i noticed that when the form is closed by using the X button or when they navigate to another form, data is automatically saved. would this be the after_update method?
Thanks.
View 6 Replies
View Related
Dec 1, 2005
Hi all
I have a financial database that gets downloaded transactions off the internet from our accounts. The problem is that the transaction payer/payee is not always unique and needs to be classified. This is easy done using If statements but I really want to enter parts of the string into a table and have a query return a category for this payer/payee. Example:
I want this: AUTO ONE CLARKSON CLARKSON WA AU006495
to be recognised as: car parts
or with this tranaction:
CLARKSON MINI MART CLARKSON553908
look for "mini mart" and return supermarket
This step will make classifying transactions a lot simpler and user friendly.
thanks
View 3 Replies
View Related
Jan 15, 2006
hi there
could somebody help in the query design in order to query table 1 (image attached), by showing the maximum weight for each component_id, but also include other details such as the date when the maximum occurred and the event_id, the result as query 2 (image attached)
if i just select component_id and weight, i can do this by selecting max weight, but when i add the date and / or the event_id columns then i get duplicates in the component_id column
any help would be greatly appreciated
View 1 Replies
View Related
May 11, 2006
I am not sure if I understand this...
I have MainTable, on which I base MainForm. I would like to have MainForm show only the records that have a null value in CertainField. If I write NullQuery to select only those records, can I redirect MainForm to NullQuery? Well, I know I can do that... but how does MainTable get updated with new records if MainForm is based on NullQuery????
Any help is greatly appreciated.
Tom
View 4 Replies
View Related
Nov 28, 2007
Action:
1) Update the blank fields in a table + add newly imported records but...make sure that there are no duplicates.
I need to Append the records from a table called: XLS_Imp_11_27_07 to my main Table " Invoice Tracking for A/P 10_30".
The fields found in the XLS _ table: Release Dt, Entry Dt, Liquidation Dt may have been populated by a live report found on Internet. Since it's a live report, when Appended, to the other table, it will create numerous duplicates.
The fields found after the 7 first fields in the Invoice Tracking Table may have been updated by users
Is there a way to avoid duplicates and get the data from one table to the other without wiping out whatever is already filled-in?
:(
View 8 Replies
View Related