Many different questions

  • Thread starter Thread starter kc58
  • Start date Start date
K

kc58

Guest
I need this report to do many things. First of all, some background info. I have members that belong to sections or groups. I need to create mailing labels for these groups. Sometimes I need to just extract one section, but other times, I need to extract multiple sections into one mailing list. To do this, I would need delete duplicate entries within the joined queries. For the user interface, I want to use check boxes to allow a user to pick which section or sections they want extracted into a mailing list. When they have made their selection(s), they would click on an "Extract" button. Because mailing labels would be a standard report, I also want to be able to use that as a template and just use VB to change the record source. How would I go about creating a form/report/coding for this? Any help would be greatly appreciated. Thank you!
 
Set up a form with your checkboxes and a command button to print the report. The command button will need some code attaching to its OnClick event. it could look something like this:

(I have assumed your checkboxes are called 'Box 1', 'Box 2' etc. and that you have a table called 'Labels' with the addresses for the labels in)

Sub SetupLabels()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM Labels ")
rst.MoveFirst
IF Forms![Your Form]![Box 1].Value=TRUE rst.MoveFirst
(Everything from IF to rst.MoveFirst needs to be on one line)
IF Forms![Your Form]![Box 2].Value=TRUE rst.Move 1
(Everything from IF to rst.Move 1 needs to be on one line)
IF Forms![Your Form]![Box 3].Value=TRUE rst.Move 2
(Everything from IF to rst.Move 2 needs to be on one line)
rst.Close
Set dbs = Nothing
End Sub


And repeat this for boxes 4,5 and however many sorts of labels you want. On your report you can then set up a text box with the record source set to the 'Labels' table and Bob's your uncle! (I think - I haven't actually checked to see this works...)

Hope it does!

Dan


[This message has been edited by Danny Clarke (edited 02-29-2000).]
 

Users who are viewing this thread

Back
Top Bottom