ub form query

NickNeville

Registered User.
Local time
Today, 14:27
Joined
May 17, 2009
Messages
119
Good morning all
I wonder if you can help with the following please.
I have a sub form which is in datasheet view on another form and when I enter details on the subform I would like to print a report on click of a button.
The problem is that the report is empty of thos details unless I select the entry on the subform firstly. IE the form's entry has a small pencil shape at the beginning of the line and when that record is selected that pencil shape turns into a small black "right pointing" arrow shape.

So my question is can I enter a piece of code on my report producing button to accept that entry rather than having to click in the datasheet first. ?

I am trying to reduce the "clicks" to produce the report.

Many thanks
Nick
 
Hi

You could try changing your subform from Datasheet to Continuous Forms in the Form Properties box.

Then I assume your report is working from a query, if this is the case simply add a command button in design view to the subform and use the wizard to select Print Report. Thne just click the print button next to the record you require

Hope this helps
 
yes that works, thankyou so much for your quick reply
best rgds
Nick
 
The real issue was just that the record needed to be saved prior to printing. You could have simply put some code in the after update event of one, or more, controls to save the record if there were changes to save:
Code:
If Me.Dirty Then Me.Dirty = False
 
Hi Bob
I am not sure I understand, :dirty: is the control name or whatever I have on the sub form, but where do I put the code and why False ? could you explain that for me. Sorry I am a touch new to this code stuff.
rgds
Nick
 
:dirty: is the control name
No, dirty is a property that the form becomes when ANYTHING on the form (bound form) has been changed or added.
or whatever I have on the sub form, but where do I put the code
In the AFTER UPDATE event (like I wrote before) of one OR MORE of the controls that you would be filling in before printing and it wasn't showing up for you.
and why False ?
If the form is dirty then it is true if you set it to False it saves any changes
 
ok I will give this a try, sounds good ,many many thanks.

I may , just may be back !

rgds
N
 

Users who are viewing this thread

Back
Top Bottom