473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Printing current form record

266 256MB
i have a form that lists job orders for a given day that i enter myself, and then i have a print button with the following code
Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me!ID) Then
  2. MsgBox "Please select a valid record", _
  3. vbOKOnly, "Error"
  4. Exit Sub
  5. End If
  6. DoCmd.OpenReport "WORK ORDER REPORT", , , _
  7. "ID = " & Me!ID
i have made a report that will print the current record based on the "ID" field. this sort of works except for the fact that when i type in my jobs, and click the print button it just prints a blank report, but if i close the form and then reopen it and go to the record i want and click print, it works fine... is there any way to remedy this and just click print, instead of having to reopen the form... thanks
Aug 15 '11 #1
4 1542
NeoPa
32,556 Expert Mod 16PB
Perhaps you could redo your last paragraph. Imagine the person reading it needs to understand exactly what you did when and what happened in those circumstances.
Aug 15 '11 #2
didacticone
266 256MB
ok sorry about that, essentially if i fill in my form and click the print button, my report prints out but its blank. if i close the form and reopen it, then click print, the data prints. it seems as though the data is not recognized by my report until i close and reopen the form. does that help?
Aug 15 '11 #3
patjones
931 Expert 512MB
Hi,

It sounds like you have a list box or some other means of displaying a list of jobs on the form, and that when you select one of the records and hit your print button, you want the report for that record to print. Is this correct?

Pat
Aug 15 '11 #4
NeoPa
32,556 Expert Mod 16PB
Let me take a stab at what you're trying to say. I've tried to read between the lines here but there's still very little reliable information to work off so let me know if I've got it wrong) :
You have a report that should be opened (for display only as far as the code goes), but when running the code above (Post #1), instead of showing the matching record in the report, it shows an empty report.

The form has a control (possibly TextBox but ?) called [ID] which is used to filter the report. The [ID] value is numeric and is stored in a table that the form is bound to. This may be the same table the report is built on (bound to) but it may not. Whenever the {Print} Command Button is clicked, the [ID] from current record is the one that is used to filter the report.

If you can confirm this is what your question should have said then I can tell you that your code ought to be working and something strange is going on here. If, on the other hand, my assumptions about your question are wrong in any detail then you need to point that out.

If there is something strange going on, that is no cause for serious alarm. We can often manage to resolve quite complicated issues here, as long as we have a clear understanding of what those issues are.
Aug 15 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Phil | last post by:
I am looking to set up a hyperlink control on a form to retrieve letters that correspond to a record on a form. That is, there may be 100 form records, and I would like each of those form records...
3
by: sea | last post by:
I need to be able to print the current form because the form has an embedded object of a .gif file, so report will not work -- does anyone know the way to do this? I tried some code, not sure what...
16
by: usenet | last post by:
I want to be able to use the record numbers of a sub-form, are they available anyhow in VB (Access 2003)? I want to use the sub-form record number as *part* of the primary key for the table...
2
by: MLH | last post by:
Suppose that code running on FormB is moving the focus around on FormA to various textbox controls on FormA - Which form is the current form during this process? Is it FormA, which has the...
3
by: Deacon Dan | last post by:
I want to be able to keep the current form on the current record. That is, the arrow key, the tab or the enter should not cause the form to go to next record or previous record. Preferably loop...
4
by: gary.cobden | last post by:
Hi I have a form/subform where a new record is created on the subform by a button click. After the new record is created, I then need to go directly and display the new record in the subform....
2
by: herbiegrey | last post by:
Hello This is my first post on the forum so hello everyone. I have a problem with access that I can't manage to view the current form record as a report ready to be printed. I have a list...
5
by: Marks | last post by:
Right I'm don't feel so nervous tackling VB as much now but basic stuff I'm great with so the next part of my script is: 1. Having a Front Menu. When you enter the number 1 in a textfield it...
1
by: thread | last post by:
Hi i built a form that getting dynamic SQL string,the SQL string is placed in the record source when the form is opened. i notice when trying to reduce some proccess time from the form that it...
2
Soniad
by: Soniad | last post by:
Hi, In my website, I show commodity details on daily basis.These details are stored in one table for each day. I select record by matching current date and current date records are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.