Automatically creating labels from the database

sho ryu ken

Registered User.
Local time
Today, 16:46
Joined
Aug 12, 2005
Messages
15
Hello, this is my first post here. I am a novice to Access. I hope someone can help me.

I have created a database for my business. It contains customer info (name address etc) as well as jewellery repair info (what the item is and what needs to be fixed). It is all entered into the same database via a userfriendly form (so my semi-computer-literate staff can use it). But I need it so that two different labels can be printed, both having a different set of fields from the database. Now, I know how to create a report/label manually, but how can I automate the process? Preferably I would like to be able to print both forms with a touch of a button!

Thanks to anyone who can help
 
After you create the two labels, use the wizard to put a button on the form and go through the steps to do the Report Operations for one of the labels. Then look at the code that was automatically generated by using the Event/On Click - should look like this:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

stDocName = "lblCitOfcMailingLabel"
DoCmd.OpenReport stDocName, acNormal
Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

Then copy the two lines for stDocName and DoCmd.OpenReport and change the stDocName to be the name of the second label. Now when you press the button both labels will print.
 
Hello, thanks very much, I just tried that and it works.

That leaves just one issue : I need to automatically generate the two report labels based on the information the staff member types in at the time. i.e. customer comes into the shop, staff member takes details, then presses a button on the form, and it automatically generates the report (label) based on the information just entered into the form then prints it. Is this possible?

Thanks
 
Guys, ignore that last question. I only just realised that reports are automatically updated when you enter more info into the database! :eek:

So one more question, how to I tell it to print the current entry of the report and not the whole thing?
 

Users who are viewing this thread

Back
Top Bottom