Link to home
Start Free TrialLog in
Avatar of Ronald Malk
Ronald MalkFlag for Australia

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
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ronald Malk

ASKER

Thank you so much It was so simple answer and it worked perfect
You are welcome!

/gustav