Printing A Refport Based On Form ID Number

Jan 16, 2006

Hi all,

Im trying to print a report from a form. I want the report to have the contents of the forms current record.

The underlying table has an autonumber as it's index/primary key and it's this im referencing. What happens is a record is saved and the autonumber is generated.


DoCmd.OpenReport stDocName, acPreview, , Me.RefID.Value ' the value of the forms id box

= [RefId]' the value on the report

The problem i have is this:

when i ask it to return the record which shares the id number of the current form record i get a blank report with no error.

when i ask it to return the record equal to a specific record number - by swapping the varibale for a fixed value i get all records- can anyone suggets what is going on here?

greg

View Replies


ADVERTISEMENT

Reports :: Printing Report Based On Filtered Results Of Form

Jun 26, 2013

I am trying to print a report based on the filtered results of a form where the data record source is generated from a query. What I have is five unbound comboboxes on a form that filter the results of the query on a subform which works fine in whichever combination I set, I then want the report to print out the results of the filter and the filter combination that I used - basically exactly as it appears on the form (I have used the same query / subform in the report with text boxes to show the filters used on the form). My VBA skills are quite limited (but improving!) and I have trawled the web trying different code examples but can't seem to get it nailed. Current filter code follows;

Code:
Option Compare Database
Option Explicit
Private Sub PrntConfigReport_Click()

[Code].....

View 3 Replies View Related

Question On Printing A Negative Number In Brackets: -5 -> (5)

Sep 7, 2004

I want to print negative numbers in brackets without the negative sign:
-5 beccomes (5)
I am doing this on a control that I am summing on. Currently this is what I am doing in the "Control Source" field.
IIF(Sum([field]) < 0, "(" & -Sum([field]) & ")", Sum([field]))

This works, however, I would assume it is running the sum 3 times (I do not know access internals, I may be wrong and would like to be corrected).

Is there a way to do this using the "Format" field??

Thank You
newbie and learning

View 5 Replies View Related

Forms :: Way To Limit The Number Of Entries A User Can Make To A Form Based On A Value

Jan 20, 2015

My problem is the following: when I receive say 5 computers in a purchase form, I want to register the serial number of each of them in another form, bound to another table.If I receive 2 units in the purchase form, my user should only be able to input 2 records in the serial form (a continuous form), if we receive 3, then only 3 records,I cannot quite figure out how to build this second (serial number registration form), so that it refuses input after the correct number has been reached.

View 14 Replies View Related

Reports :: Save Access Form Based On Order Number And Client Name Using VBA

Apr 28, 2013

I have an acces form to input client orders. Each order has its own order number a different client. On the same form I have a button to generate a report based on the inpuuted data on the same form which works perfectly fine.

Now I need to use same report to save each order in a specific folder on my computer in pdf format. However I would like to have the file generated as follows ordernumber "-" clientname.pdf. This way each order is saved in the same folder without overwriting the previous one.

View 1 Replies View Related

Help With Printing A Report Based Off A Query.

Jun 13, 2006

Hi all..

I have a drop down list on a form that prints a report based off of the selection in the cbo box...

(I have already changed the query and relationship for the lookup and maintable)

Here is the code that works fine,(this is on a command button)

Private Sub cmdViewStreet_Click()
stDocName = "rptStreetName"
On Error Resume Next
DoCmd.OpenReport "rptStreetName", acViewPreview, acEdit
Me.cboStreetName = Null
End Sub


What I am doing now.. is this: the look up table that had the street names but did not have an autonumber or primary key. I added in a autonumber and primary key. I can get the cboStreetName to list the street names and not the autonumber.. and I can get the main table to store the autonumber not the street name (this is what I want).. but now I can't get it to view what is in the cboStreetName... When I hit the view button it does nothing... Any suggestions?? If you need more info please let me know...

I tried something like this to:

Private Sub cmdViewStreet_Click()
On Error GoTo Err_cmdViewStreet_Click
Dim stDocName As String
stDocName = "rptStreetName"
DoCmd.OpenReport "rptStreetName", acPreview, , "[StreetName]=" & Me.cboStreetName.Column(0)
Exit_cmdViewStreet_Click:
Me.cboStreetname = Null
Exit Sub

Err_cmdViewTitle_Click:
MsgBox Err.Description
Resume Exit_cmdViewTitle_Click

End Sub


R~

View 1 Replies View Related

Modules & VBA :: Change Number Of Decimal Places Based On Value In Textbox On Main Form

Apr 11, 2014

I have a subform that displays doubles in a textbox as fixed with 4 decimal places as default. I have been trying to change the number of decimal places based on the value in a textbox on the main form. I have tried this:

Code:
Forms![Main Form]![Holder_subform].Form![Final PCT].[DecimalPlaces] = CByte(Forms![Main Form].Numdecs)

where [Final PCT] is the textbox on the subform containing the decimal number and Numdecs is the textbox on the main form containing the number of decimals I want to use. I want to implement this Form_Current sub.

View 2 Replies View Related

Printing A Report Based On The Current (new) Record

Nov 23, 2006

Hi All,

Having a problem with a report, I have a form that i use to enter a new record to my database, what I want to do is put a button at the bottom of the form to print the record (via a report)

If I base this on a record that already exists, it works fine.
However,
If I have just entered the record the query the report runs off doesn't see the new record. To print that record I have to exit the completed record, then go back in to it and print.
My aim is to remove this additional part of the process, I'm sure it's something really simple, but can anyone help?

Many Thanks
Paul

View 2 Replies View Related

Forms :: Auto Generate File Number Based On Number Of Records In Year

Jan 21, 2014

I have a form [IUDATA]

I have a add record button.

I have a date field [DATEIN]

I have a text field [DRPNO]

If the [DPRNO] field is empty, I would like the user to have the [DPRNO] field be automatically populated after the user enters a date.

I'd like the format of [DPRNO] to be "dpr YY-XXX"

Where:
YY is the year of the [DATEIN] field and
XXX is number of records in that year.

So for example, if it was the 4th record with a 2013 date the [DPRNO] would be dpr 13-004.

View 12 Replies View Related

Modules & VBA :: Printing Code Slowing Down Printing Reports?

Feb 25, 2014

I was having trouble just setting each report with a particular print method - for some reason they just kept forgetting their individual settings and resorting to default on the machine.

This meant reports were printing on the wrong paper, or the wrong size paper, the wrong orientation and some times refusing to print if it couldn't find the paper (which is useful in runtime as it doesn't display error messages)

So I used Reports(rpt).printer properties (I forgot where I found this) to hard code the printer properties into each print command... this meant I had to use another function to insert the variables.

So all I had to do was say:

Code:
PrintMe("Invoice","InvoiceID",iID)

and a report would print to exactly how I wanted... but it's just too slow!

See attached for full code, I have a niggling feeling it may be the function: PrinterOK, to make sure the printer exists or not.

Code:
Function PrinterOK(sPrinterName As String) As Boolean
Dim MyPrinter As Printer
PrinterOK = False
For Each MyPrinter In Printers
If MyPrinter.DeviceName = sPrinterName Then
PrinterOK = True
Exit Function
End If
Next
End Function

I know it's the printing code, because if I stop the printing and just preview then it shows up almost instantly.

View 1 Replies View Related

Printing Sub-Form

Apr 12, 2006

i have a search form with a sub form displaying the results, how can i send the results to a report to print out or just print the results?:confused:

View 5 Replies View Related

Form Not Printing Anything

Apr 26, 2006

I have a form with multiple subforms. When I hit print selected record I get a blank sheet of paper. What could be set to not allow the data or the background of the form to print?

If I just print the subform out by itsself it works good. However when I have the main form open then try to print I get blank pages.

I am sure someone changed a fairly small setting, but I do not know what has been changed. Thanks.

View 1 Replies View Related

Printing A Form

Aug 9, 2006

:eek: When I go to print the form, it repeats the detail section over and over. Instead of being one page, it is 1414. How can I fix this problem? Thanks

View 4 Replies View Related

New Number Based On LastId

Dec 6, 2005

Hi I have a couple of tables that should have an automathed value.
What I need is to get the last RecordId from the table from where we get the last RecordNr and insert the next value (RecordNr) in a new record.
I tried to do this autom. in the table by making the RecordNr a numeric Value with a mask for 000 numbers and a +1 as a standard value but it doesn't work.
What can I do? Should it be a function/query?

View 2 Replies View Related

Value Based Upon Number Range

Apr 14, 2006

I am creating a query which determines the number of days a payment is delinquent. Is there a function I can use in a query field that would look at the numeric field and if the value of the subject field was:
< 60 Days "30-59 days"
< 90 Days "60-89 Days"
<120 Days "90-119 Days"
>=120 Days "120 Days +"

It was my understanding that the IIF function tests for a condition and can only return yes/no results. I seem to remember that SQL had something like a least or most function that would allow me to set maximum value for range of days. I apologize that my question is confusing and hope you can understand what I am trying to accomplish.
Thanks for any help

View 2 Replies View Related

Skip Row Number Based On A Value

Dec 5, 2011

I have a report that is set up to count students in a class. Looks like this:

# Student Cert #
1 John Smith 12340
2 Joe Jones 12341
3 VOID 12342
4 James Adams 12343
5 Tom Arnold 12344

I want it to do this:

# Student Cert #
1 John Smith 12340
2 Joe Jones 12341
VOID 12342
3 James Adams 12343
4 Tom Arnold 12344

The row number is just a text box (=1) with the running sum turned on.

On this report I have to report all the certificates used for this class, in order. So I can't put the voided ones at the bottom.

I tried an IIF statement in the text box =iif([student]="VOID", "", 1)

This skips the VOIDs but starts over at 1 (no matter if it is set to "over group" or "over all"):

# Student Cert #
1 John Smith 12340
2 Joe Jones 12341
VOID 12342
1 James Adams 12343
2 Tom Arnold 12344

View 2 Replies View Related

Forms :: Parameter Based Query - Filter A Form Based On Another Form

Mar 20, 2013

I have a form which uses a parameter based query to present an individual senior doctor with a list of names for of individual juniors to provide an assessment report on. When the first form opens the user enters their RespondentID.

Once senior has decided which names to comment on I have another form which has the questions to be answered which is opened by clicking a button on the first form.

How can I pass a parameter from the first form to the second so that only the records relevant to that senior doctor are displayed? The underlying table has 60 senior doctors and 20 junior doctors. The senior doctor is identified by the field RespondentID in the first form. I've tried putting a WhereClause in the FormOpen command but I still get a dialogue box asking for the parameter RespondentID when the second form is opened.

View 2 Replies View Related

Printing A Report From A Form

Aug 30, 2006

Hi

I'm pretty new to all of this. I've set up a simple database. I have a form in it for inputting information and then there is a command button on the bottom which prints out a report I've created with the information on it. This is all working great except it prints evey record and I only want the current record printed out.

I've tried the help and it goes into detail about OpenReport and PrintOut in macros. I have no idea what a macro is or what to do with it.

Can anybody please help me and give me step by step instructions as to how to print out only the current record in the report from the command button.

Your help is greatly appreciated:)

View 1 Replies View Related

Printing A Form To A Report

Nov 1, 2006

I have a form (entry screen to enter data) I then created a report in the layout I need for my order form. I want to creat a button that a user can press and it will print the current record to the report (order form layout)

Here is my current code for the print button on the form page:
Private Sub btnPrtOrderFrm_Click()
On Error GoTo Err_btnPrtOrderFrm_Click

Dim stDocName As String

stDocName = "rptOrders2"
DoCmd.OpenReport stDocName, acNormal

Exit_btnPrtOrderFrm_Click:
Exit Sub

Err_btnPrtOrderFrm_Click:
MsgBox Err.Description
Resume Exit_btnPrtOrderFrm_Click

End Sub

The only problem is when I tell it to print if I am on record number 2 on the form, it prints both record 1 and record 2. I only want the current record i am in to print. Any ideas much appreciated

Dean

View 2 Replies View Related

Printing Form From Table

Dec 10, 2005

Hello all- New here and working with a database for my boss. I did not create this rather am modifying it. I have a table (vehs) that contains information for three different departments regarding their vehicles. This database also has a form that prints (when clicked once) all of this data to the local printer. I need to make three sub forms to print similarly but just by department number (in other words only department 1's vehicle data) I'm not too big an access guru so if I need to supply any more data please let me know

Thanks,

John

View 11 Replies View Related

Printing Report From Form

Jul 28, 2006

I had made my own database for my own business.

I am trying to print a report from a form. Once i enter an order detail i finish off by printing a letter. At the moment we are doing this via a query by entering the order id.

I want to automate this so for the form record i am in i want a button to print a report for that record only.

I know this can be done as i rember doing this in college but i cant get my head round it at the moment.

Please help

View 2 Replies View Related

Printing Form On One Page

Aug 22, 2006

After having designed a series of forms, I have just been told that users would like to occasionally print the data.
On testing this, it seems that the data does not print onto 1 page.
Are there any settings to fit data to 1 page wide only?

Aternatively, is there a better way of doing this? Perhaps by using a report or something like that?
The form has a whole load of calculated fields (calculated control boxes with expressions) so would I run into any problems doing it ths way ?

Thanks.

View 1 Replies View Related

Printing Filters In A Form

Oct 25, 2006

Having trouble printing after I performed a filter. Have a subform with continuous forms that I put various filters on..., however when printing, all the records print and not just what was filtered...Is there a way around this. Basically, I would like to be able to print out only the filtered records in my form view.

Max

View 7 Replies View Related

Printing A Blank Form

Sep 1, 2004

I created a form that opens to a blank form. I also have a print button on the form. I want to be able to print the blank form, but nothing happens unless the primary key has a value in it. Is there a way to print just a blank form? I have been working at this problem for a few weeks. Please help!

View 1 Replies View Related

Form Printing Question

Sep 3, 2004

How do you setup the form to default print to a legal size paper?

View 3 Replies View Related

Printing A Blank Form

Aug 23, 2004

I have a bound form that I created. I want to be able to print a blank form. When I click on my print button, nothing happens. Also, when I click on the print icon, I get the following error:

PCL XL error

Subsystem: KERNEL
Error: IllegalStreamHeader
Operator: 0x0
Position: 0

Here is my code for the print button that I created:

Private Sub cmdPrint_Click()

On Error GoTo Err_cmdPrint_Click
DoCmd.PrintOut , Me.CurrentRecord, Me.CurrentRecord
Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

Am I using the wrong code? I really need to be able to print a blank form!

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved