Print Report while entering data (1 Viewer)

Kill_Switch

Go Easy I'm New
Local time
Today, 15:00
Joined
Apr 23, 2009
Messages
58
Hey all. I currently have a database that we have to enter any stock ordered and received.

Problem is, is when we have to enter the data into the database, we also have to hand write out a form for acquisition of that item.

Is it possible to enter your data into a form, and once all you info is done. Click "Print Demand and Save" So your form will get printed, and save your data to your table.

**** EDIT ****
For to add that, I can print but it prints out all the records and not just one. I'm starting to believe its a query criteria that it missing!

The query is "Supply Data - Print 2227"
Report is "DND 2227 Demand"
Table used is "Supply Data Table"
**** /END EDIT ****

Example database is here. Open database and click on "new demand". This is the previous edit, so everything else works, just the print command.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:00
Joined
Aug 30, 2003
Messages
36,133
I haven't looked at your sample, but I would create a report for printing rather than trying to print the form. Then, I would use this technique to make sure the report only prints the record currently on the form:

http://www.baldyweb.com/wherecondition.htm
 

Kill_Switch

Go Easy I'm New
Local time
Today, 15:00
Joined
Apr 23, 2009
Messages
58
I haven't looked at your sample, but I would create a report for printing rather than trying to print the form. Then, I would use this technique to make sure the report only prints the record currently on the form:

http://www.baldyweb.com/wherecondition.htm
Sorry if I made my first post unclear. I am printing a report. However I'm trying to print a report based on the data entered on a form. So when I hit print "demand" it will save the data onto the table and print the report using the data table as the record source. Kinda have to look at it I think to see.

I'll check your link out once I get home, cannot view due to work's security settings atm.

thanks.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:00
Joined
Aug 30, 2003
Messages
36,133
The technique would work well for what you describe. Basically it uses the wherecondition argument of OpenReport and it would look like:

DoCmd.Report "ReportName", , , "FieldName = " & Me.ControlName

More info on the link and in VBA Help.
 

Kill_Switch

Go Easy I'm New
Local time
Today, 15:00
Joined
Apr 23, 2009
Messages
58
Hi, kinda really new to access and not familiar with VBA.

I've managed to duplicate a query, and use the unique "customer control number (p-key)" to print off the page that I want.

Problem now is that after I'm done entering all the data to be entered into the database, and the control number gets auto generated (displayed on upper left corner for the user).

And hit print, the query criteria that I have set up asks for the control number of the form to print, which is okay, but the user has to remember the control number in order to print, but the form goes away after I hit print. It not really that much of a big deal to remember 4-5 numbers, but you all know people who are not the sharpest knife in the drawer.

Is there are way to keep the form to remain open so they can see the control number so there is no back and forth trying to track down there new demand?

So basically the Query look like this for the Print button

Under Customer Control header for the table
Criteria: [Forms]![SupplyData-Input]![CustomerControlNumber]

And the macro looks as follows
MSG Box
OpenReport
-Report Name: DND2227 Demand
-View:print
Close
-Object Type:Form
-Object Name:New Demand
-Save: Yes
OpenForm:
-Form Name:Main (My main "splash" form/page)
-View:Form
-Window Mode:Normal

Sorry pbaldy, if I'm being hard on the head, but I'm learning alot from access guys like yourself over the last month. a-p.co.uk is amazing.
 

raptor_5

New member
Local time
Today, 12:00
Joined
Feb 8, 2015
Messages
4
Did you ever get your database working? I am working on one that uses DND 2227 at was wondering what stage you were at
 

Kill_Switch

Go Easy I'm New
Local time
Today, 15:00
Joined
Apr 23, 2009
Messages
58
It has been used for years now (I'm assuming it's still in use). I am not longer with that work place, but I do have a copy of the database.
 

raptor_5

New member
Local time
Today, 12:00
Joined
Feb 8, 2015
Messages
4
That would be excellent if I could get a copy, and possibly use it with your permission of course.
 

Kill_Switch

Go Easy I'm New
Local time
Today, 15:00
Joined
Apr 23, 2009
Messages
58
For sure. Whats your email so I can get a hold of you (on the DIN hopefully).
 

Users who are viewing this thread

Top Bottom