Hi,
I read your answer about this topic http://bytes.com/topic/access/answer...ry-result-form
I write a program in C# that connect to Access DB and show the result,
I have 1 query in Access DB to get sum of one column and in my C# form there is a text box to show the result of this query.
I couldn't use DLookup() function that you said in there?
does it need special using...
User Profile
Collapse
-
PS: Forgot to attach this link to MS Access Demos on various topics, some of which relate to what you are doing.
http://office.microsoft.com/en-gb/ac...739911033.aspx... -
Attached, please find a revised extract of your mdb and a word document with my comments. Hope this helps....Leave a comment:
-
Leave a comment:
-
OK, I checked out the problem with FTABudget in srptBalanceDeta ilUPA (the subreport). This amount is in the Project footer section and the expression bound to this control should be: = Sum([FTABudget]), not FTABudget. Remember, any time you have a header or footer, you are dealing with the total of the detail line amount, and therefore, the field name must be preceded by the equal sign and the word "Sum" as shown above. By the way, you...Leave a comment:
-
Try it this way:
'year0
If chk_year0 = -1 And nz(chk_year1,0) = 0 And nz(chk_year_2,0 ) = 0 Then
rst.Fields("tar get_spb_year_li st") = year0.Caption
End If
False does not get checked, so it is returning a null. Using the null to zero function converts the nulls to zero with zero being false.Leave a comment:
-
It is going to be a few days before I can look at your file (I generally don't work on the weekend).
In the meantime, here is a download link for 28 Access DB Templates that you can download. I suggest you take a look at the Accounting Ledger template and the Expense Reportng template.
http://databases.about.com/od/access..._Templates.htm...Leave a comment:
-
If you can convert your file to version 2000 compatible format so that I can read it, go ahead and attach the file here. I don't know how soon I can get to it, but I will look at it ASAP.
In the meantime, take a look at these links. the first one has data models from various access applications. Take a look at a couple of them and see how they were done.......for example, look at the one for hotel and room booking. The second link...Leave a comment:
-
I am glad you found a solution that you can live with. I still feel there is a flaw in your DB design that will continue to require you to find a work-around.
Without seeing your relationship window, this is all conjecture. I think you should have had an account code table that had a field for transaction type. That could be use to join revenue and expense transactions that affect the same account code. If you are interested, you...Leave a comment:
-
You are getting a painfull lesson on what happens when your database design is flawed.
Your business model is such that one grant can be used for many projects and one project can be funded from many grants. Your business model thus contains a many to many relationship between grants and projects for which Access, like other relational databases, can not enforce accurate results, and must rely on the database designer/programmer to...Leave a comment:
-
You did not move the textboxes over and make them visible so you can see the detail making up the total? You don't have separate textboxes for Budget and Change in the detail? you need to. Then the subtotal calc becomes:
= Sum([Budget]+[Change]). hopefully with textboxes visible can identify whch one is the nissng jnm dLeave a comment:
-
When you say it is not working, can you tell me what the amount should be, or better yet, make the textbox for the budget detail visible for testing purposes and place the textbox in blank space between the category and expense detail. That way, we can see budget detail making up the subtotal. And remember what we discussed before.
1. The textbox control in the detail section should not have an equal sign or the word "sum" it...Leave a comment:
-
Yes, that is what I wanted. I think I know what the problem is. You are trying to come up with the Budget subtotals w/o any detail amounts in the detail section. Expenses are no problem because you have a detail amount in the detail section, and quite simply, the total is the sum of the details. If that is the case, the fix is this: Put a tiny, hidden (set visible property to no) textbox control for the detail budget amount , and set your subtotal...Leave a comment:
-
Based on the title of your problem, is it just the report footer section that is missing? If the report footer section is missing and you using a page footer, then all you need to do is go to view on the command menu, and select report header/footer and Access will add a report header/footer section to the report. Then all you have to do is drag the controls from the page footer (not needed), leaving the page footer empty.Leave a comment:
-
It might if V 2000 format was selected as the database format. If it wasn't, then
try to send a snapshot of your report in design view.Leave a comment:
-
if your Access version is not V 2000 or compatible, I won't be able open your file. Otherwise, ok to send.
what happened with the field named "Change"?
if you have no detail section in your report, then in your group header or footer, you should try totalBudget>> = nz(Sum([Budget],0) + nz(Sum([Change],0)Leave a comment:
-
let's go over a few basics:
1. all fields in your query should appear in your report, unless you unchecked the show box in the query grid, Is that what happened with [change]?
2. any amounts appearing in the detail section of your report are detail amounts and should not be preceded with an equal sign or the word sum
3. any amounts appearing in a group header or footer should be preceded with an equal sign and the word Sum...Leave a comment:
-
ok, look at the formula shown in the grouping control for the budget amount. In order for that formula to work, it has to be preceded by an equal sign or it won't work correctly. it should look something like this:
= Sum([BudgetAmount])
Replace BudgetAmount with the actual name of the field as used in your application.Leave a comment:
-
If you used the sorting and grouping tool on the icon bar in design view, it over-rides any sorting or grouping done in the query, so look and post back what is showing in the sorting/grouping tool.Leave a comment:
-
Hi Phil,
In case you or anyone else is interested, here is the entire code for the daily booking form used in the application. The code is triggered on the click of a calendar control button that is used to select a booking date that denotes the beginning of the 14 day booking period for which the bookings are displayed.
Code:Private Sub Calendar4_Click() Dim Db As DAO.Database Dim rs As DAO.Recordset
Leave a comment:
No activity results to display
Show More
Leave a comment: