I used autonumber for my id. i attach the screen shot..

and i dont know how to make a code for compute command..

It should compute all the payments on that day, but i really dont have an idea how to make it.. ill attach my vb and access so you can guys take a look..
Access And VB.zip

thanks guys :D

Dani AI

Generated

Quick, practical notes that build on the thread: used an AutoNumber and wants a display like 00-000, and wants a daily total. was right — a SUM in a query is the right direction. Format the AutoNumber for display only (keep the field numeric). In a query or a form/report control use a Format expression such as:

FormattedID: Format([ID], "00-000")

That keeps sorting and joins correct while showing leading zeros and the dash.

To total all payments for a given day, use a totals (aggregate) query so the database does the work. If the date field may include time, strip the time with DateValue. Example SQL for today:

SELECT Sum([Amount]) AS DailyTotal
FROM Payments
WHERE DateValue([PaymentDate]) = Date();

For a user-selected date use a form parameter:

WHERE DateValue([PaymentDate]) = [Forms]![frmMain]![txtDate];

If preferring VBA, DSum is an option but is slower on large tables; prefer a query for reporting.

About printing with Word: create a saved query filtered to the day (e.g., qryDailyPayments) and use Word Mail Merge > Select Recipients > Use an Existing List to point to that query. For layout-heavy receipts or grouped totals, Access Reports are simpler and usually give better control over pagination and grouping than Word. Short caution: date literals in SQL depend on locale — use DateValue or format to an unambiguous form when building criteria in VBA.

Recommended Answers

All 5 Replies

update... help :)

Well you could use the SUM(fieldname) in a query but it is hard to tell with what little information you have given...

Good Luck

what the problem friend?

what the problem friend?

that's why im asking for any info i can have so i can make a lil one..

sorry then.. ooo btw, I was not asking for you guys to make code..

i was just asking for some info :D

sorry about the post.. i was drunk. hehe..

do you guys have some notes that i can read on my problem?

the problem is, i dont have the knowledge on printing something using MS word..

and im not familiars with queries.. can you guys explain it to me?
hehe.. thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.