By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,382 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

Send to rpt before moving to a new record

P: n/a
Hi, i have a little problem: I have a form where people enter data and
when they click on the save button it saves the data then open 2 field
for my criterias and then open a rpt with that. But when i enter the
criterias all the data that i jut put in the tform r gonne to my table
and r no more visible.

exemple : I fill the form, i click save, the form moves to a new record
(blank), 2 message box open for my criterias,one i fill those 2 boxes
with the ID and Date that i've just put in the form then the report
prints (i dont want to see the rpt, just print it). But what i want to
do is: Fill the form, click save button and automatically send the data
i just put in the form to my rpt and print it (dont want to see the rpt
open but just print it with my data), then go back to a blank (new)
form.

As far as i know, i have to save it before being able to put it in the
rpt to print it.

I've just start using the DoCmd and its wonerfull but i'm not sure if i
can call the print job before the acNewRec(i thnik that this is where
it moves to a new blank form)? I dont mind entering my criterias (Date
and ID) but if it can be done automatically it would help me a lot.

My code:

Private Sub addbutton_Click()
On Error GoTo Err_addbutton_Click
DoCmd.GoToRecord , , acNewRec

Call Print_Click (i use to have a print button...so i didnt change it,
the print button is invisible)

Exit_addbutton_Click:
Exit Sub

Err_addbutton_Click:
MsgBox "Error....bla...bla...bla"
Resume Exit_addbutton_Click

End Sub


Right now i can use it and it doesnt bother me too much, but i dont
think user will find it easy.

any help would be appreciated

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You need to save your record BEFORE you go to a new record and
use the values from your specific form's controls as the criteria for your report.
AFTER that you can move to a new empty record like:

1 DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
2 Call Print_Click
3 DoCmd.GoToRecord , , acNewRec

--
Hope this helps
Arno R
"No***********@hotmail.com" <ug********@hotmail.com> schreef in bericht news:11*********************@o13g2000cwo.googlegro ups.com...
Hi, i have a little problem: I have a form where people enter data and
when they click on the save button it saves the data then open 2 field
for my criterias and then open a rpt with that. But when i enter the
criterias all the data that i jut put in the tform r gonne to my table
and r no more visible.

exemple : I fill the form, i click save, the form moves to a new record
(blank), 2 message box open for my criterias,one i fill those 2 boxes
with the ID and Date that i've just put in the form then the report
prints (i dont want to see the rpt, just print it). But what i want to
do is: Fill the form, click save button and automatically send the data
i just put in the form to my rpt and print it (dont want to see the rpt
open but just print it with my data), then go back to a blank (new)
form.

As far as i know, i have to save it before being able to put it in the
rpt to print it.

I've just start using the DoCmd and its wonerfull but i'm not sure if i
can call the print job before the acNewRec(i thnik that this is where
it moves to a new blank form)? I dont mind entering my criterias (Date
and ID) but if it can be done automatically it would help me a lot.

My code:

Private Sub addbutton_Click()
On Error GoTo Err_addbutton_Click


DoCmd.GoToRecord , , acNewRec

Call Print_Click (i use to have a print button...so i didnt change it,
the print button is invisible)

Exit_addbutton_Click:
Exit Sub

Err_addbutton_Click:
MsgBox "Error....bla...bla...bla"
Resume Exit_addbutton_Click

End Sub




Right now i can use it and it doesnt bother me too much, but i dont
think user will find it easy.

any help would be appreciated

Nov 13 '05 #2

P: n/a
thk u so much,
works like a charm now.
i'll remember this line.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.