Access 2002 Form Printing: bad data coming through

Drathnal

New member
Local time
Today, 13:23
Joined
Feb 25, 2008
Messages
4
Let me start off by saying thank you for taking the time to assess my problem. 2nd let me say I know this is not good access coding but it works best for my application.

THE DB is a maintenance ticket program. When something breaks they write a ticket to schedule someone to fix it.

The user opens the form. On that form there is a combo box. Row source is a query. It has the unitname & UnitID.

This information is going int blTicket. I am passing the UnitID to the table for storing not the unit name. Therefore the column count is 2 and the bound is 1. The width is 0;1 so the user only sees the name of the unit they are scheduling.

This works perfect when you tab from field to field and into the next record. However, everything looks fine but if you print then it will print the name on the first record.

It does not store that name it just prints it. If you pull up that record again it will be correct and print correctly.

For instance, If the first record unitname was test and you went on to create the second record and the unitname is office. then when you hit print it will print test as the unitname for both of them.

I have no idea how or why.

Any help is greatly appreciated.
 
Aside from the fact that you should use a Report for printing, you need to save the record first
 
I thought as much. However I have en tried to manualy hit save before going to the next ticket and I still have the same effect.
 
I have thought about going ahead and passing to a report. However how do I do that. If the user has created 3 work orders and then they print. It prints all the work orders in the program. How do i tell it I only want the 3 that I just created?
 
As to your first problem, it sounds as if you're not storing the first selection. Unless the combobox is bound to an underlying field in your table/query or you're assigning the combobox's value to a textbox that is bound to an underlying field in your table/query, the last value selected will be the one printed out. If you're assigning the value to a textbox, you need to print that with each record, not the cbo's value. An unbound control's value stays the same as you move from record to record, with the last value entered being the value of that control in all records. This is true in Single View forms, but it's easiest to understand, perhaps, in Continuous forms. If you have an umbound field in a Continuous form and enter "Jones" in it, the control on all records will have "Jones" in it. Change one of these to "Smith" and they will all change to "Smith."

Here's a good tutorial explaining how to print out reports for single records

http://www.databasedev.co.uk/print_form_record.html

Linq
 
Last edited:
As to your first problem, it sounds as if you're not storing the first selection. Unless the combobox is bound to an underlying field in your table/query or you're assigning the combobox's value to a textbox that is bound to an underlying field in your table/query, the last value selected will be the one printed out.

The rowsource is a quary. It is bound 2 which is the ID section. The combo is storing in tblTicket under UnitID. So it is not an unbount combobox.

And it is not the last value selected it is the first value. If I write a ticket for Office and a ticket for test. Then both will say Office on the print out. But on the screen it will be correct. If I reprint that ticket it will be correct. Just when I do the initial print there is a problem.

If you're assigning the value to a textbox, you need to print that with each record, not the cbo's value. An unbound control's value stays the same as you move from record to record, with the last value entered being the value of that control in all records. This is true in Single View forms, but it's easiest to understand, perhaps, in Continuous forms. If you have an umbound field in a Continuous form and enter "Jones" in it, the control on all records will have "Jones" in it. Change one of these to "Smith" and they will all change to "Smith."

I see what you are saying but maby I dont udnerstand becouse I dont think that is what is happening here. You are correct it is in single view form. But the control is bound and only the first record is affecting the rest. So if the last record is Smith and the first is test it will still print test.
 

Users who are viewing this thread

Back
Top Bottom