Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / June 2007

Tip: Looking for answers? Try searching our database.

Make a Report Preview with New Records???????

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
guitarfunk24@yahoo.com - 12 Jun 2007 19:08 GMT
I don't even know if this is possible but ok here it goes I am making
a database and I would like to make a report that shows the data I
have on a form for new records that i would type in but NOT save the
records into my table so I can print the data out if need be but maybe
I would like to change it before i finalize it.  I have a Report
button code to open a report as shown:
Private Sub Add_Component_Click()
On Error GoTo Err_Add_Component_Click

   Dim stDocName As String
   Dim stLinkCriteria As String

   stDocName = "Add Components List Form"
   DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_Component_Click:
   Exit Sub

Err_Add_Component_Click:
   MsgBox Err.Description
   Resume Exit_Add_Component_Click

End Sub
But here is the other thing because I don't want data saved all the
time i have a code in before update on the form that asks me if i want
the data I typed saved or not.  which goes like this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
 Cancel = MsgBox("Do you want to save changes to this record?" _
       , vbQuestion + vbYesNo + vbDefaultButton2, "Save Record") =
vbNo
 If Cancel Then
       Me.Undo
 End If
End Sub
Now here is the problem when I try and click the button to open the
report it asks me if i want the data saved but i don't and if I dont
my report will not show up.  But if i do it will save it then show the
data but ruining my table.  So is it possible to show this data on a
report without saving it.
John W. Vinson - 13 Jun 2007 00:54 GMT
>Now here is the problem when I try and click the button to open the
>report it asks me if i want the data saved but i don't and if I dont
>my report will not show up.  But if i do it will save it then show the
>data but ruining my table.  So is it possible to show this data on a
>report without saving it.

It's possible, but not easy. Typically a Report is based on a query displaying
data in a Table (put there via a Form, usually). A Form isn't really a very
good data repository - I'm not sure that printing out the contents of an
unsaved form record will get you all that much ! You'll need to leave the Form
open to the record; you can look at the data on the form just as easily as on
a sheet of paper.

But... if you really want to waste paper... you can create an unbound Report
(don't base it on ANY table), and put controls on it with control sources

=Forms!YourFormName!Controlname

to display the contents of the currently-open record on the form. Do this for
all the controls that you want to see. Print the report from a command button
on the form (the command button wizard will do this for you).

            John W. Vinson [MVP]
guitarfunk24@yahoo.com - 15 Jun 2007 19:37 GMT
On Jun 12, 7:54 pm, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> >Now here is the problem when I try and click the button to open the
> >reportit asks me if i want the data saved but i don't and if I dont
[quoted text clipped - 19 lines]
>
>              John W. Vinson [MVP]

Well thank you for the help on the report problem I am still working
on it but just so you know it is for a cost analysis for a company so
we can sell ideas and how much they cost and make a neat sheet so you
can report you information.  If we where to save it because we did
want that idea then we could save it.  But I don't want to save
something we may never use.  If you have anymore help on it it would
be most helpful because I did replace my report with the formula above
but the form still asks me if I want it saved and if I click no it
deletes what I typed.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.