Ronald Malk
asked on
Print focus keeps focusing to the caller form
Hi, I’m hoping someone could help with this form printing issue, what I do usually is collect codes of the internet to achieve my purpose but now please I need some help,
I have a Split PopUp form “Frm1” has a field name "TxtA” when clicked it opens another Pop form “Frm2”, in “Frm2” I have a button “BtnPrnt“ for printing only its current page,, the problem is when I click the “Btnprnt” it prints the caller form “frm1” not the “form2” even if I close the” form1” when I click “BtnPrnt” On form2 still prints “Frm1”.
If I open the form “Frm2” directly there is no problem it prints the current record, but I need to open it from the form “frm1”,
Private Sub TxtA_Click()
Dim StkID As Integer
StkID = Me.StkID
DoCmd.OpenForm "Frm2", , , "stkID = " & StkID
End Sub
Private Sub BtnPrnt_Click()
Dim PageNo As Integer
PageNo = Me.CurrentRecord
DoCmd.SelectObject acForm, “frm2”, True
DoCmd.PrintOut acPages, PageNo, PageNo, , 1
End Sub
I have a Split PopUp form “Frm1” has a field name "TxtA” when clicked it opens another Pop form “Frm2”, in “Frm2” I have a button “BtnPrnt“ for printing only its current page,, the problem is when I click the “Btnprnt” it prints the caller form “frm1” not the “form2” even if I close the” form1” when I click “BtnPrnt” On form2 still prints “Frm1”.
If I open the form “Frm2” directly there is no problem it prints the current record, but I need to open it from the form “frm1”,
Private Sub TxtA_Click()
Dim StkID As Integer
StkID = Me.StkID
DoCmd.OpenForm "Frm2", , , "stkID = " & StkID
End Sub
Private Sub BtnPrnt_Click()
Dim PageNo As Integer
PageNo = Me.CurrentRecord
DoCmd.SelectObject acForm, “frm2”, True
DoCmd.PrintOut acPages, PageNo, PageNo, , 1
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome!
/gustav
/gustav
ASKER