I have to write part of an Access database as a demonstration to the kids in my a-level class. Most of it is done but there are gaps in my knowledge (yes a humble teacher!!) and so I wonder if anyone out there can help.
This is what happens....
1. Query is run. It is a parameter query that asks the user for their membership card number and then their password. There is no validation here as it is not needed in the development
2. User enters their details and up pops up a form. This form displays the following (based on the criteria) - Guest Name, Amount of Points. On the form is 6 buttons. The Guest clicks on of them to choose their gift. If they have enough points they can claim the gift. (I haven't done that validation yet).
3. I have created a Macro that calculates their new points total after that gift is taken off. I've avoided using code so far as it makes it easier for the pupils.
What I now want to happen is (after pressing the button) is a report to print a voucher detailing the date and gift. This bit is easy - that is to create a general report and have the macro print it.
However, what I also want to do is transfer some of the fields from the query form onto the report on the fly so that it creates individual vouchers for individual guests.
I'm sure it is easy - but I'm blank. As soon as someone tells me how to do it I know I am going to swear and say several rude words as I amaze at how dull I have been.
ANy help appreciated,
Add a new textbox to your report and set its control source under the data tab of its properties to the textbox that you want the data from in the dialogue box/form that triggers the print (should be a small button beside the control source with three dots). This should take the value on the opening of the report so that it is customised. The source should end up looking like this "=Forms!<form name>!<control name>"
I would be more tempted to do this whole thing using querys and data tables though so that accurate records are kept. For example points are stored in a seporate points table and each addition or subtraction is a seporate record. Getting the current points would just require a sum of all of their points transactions. With a time stamp added each time there is a points transaction it would allow propper tracking of their habits and auditing to make sure that the system is not haywire. The voutures could also be stored in a separate table, one per record to allow for tracking of what had been claimed when and by who. This would probably be much more representitive of a production type database.
Great stuff Synak - soooo obvious when someone tells you how to do it.
Hope you can help with my next question.... appearing in a thread soon.
Many thanks again,