-3

I'm trying to open a specific recordset in a print preview but Access can't find my variable. I'm getting a Runtime Error 2465. The variable I want to Access is in a public Sub.

Public Sub PrintPreview_Click()
DoCmd.OpenForm "Form1", acViewPreview, , "Number1 = " & Me!Nummer2
End Sub
1
  • 1
    In reply to a proposed answer you write "no its not the typo i just edited the variable for stackoverflow. Original Code -> DoCmd.OpenForm "Personenkonto", acViewPreview, , _ "[Belegnummer] = " & Nummer" -- If you want people to help you you MUST provide accurate information. Your code sample should show exactly what the problem is - you can't use "Number" in the title and then not show corresponding code! Commented Nov 12, 2018 at 13:44

1 Answer 1

0

it seems that you have a typo.

where says "Me!Nummer2" doesnt you meen "Me!Number2"

thanks

1
  • no its not the typo i just edited the variable for stackoverflow. Original Code -> DoCmd.OpenForm "Personenkonto", acViewPreview, , _ "[Belegnummer] = " & Nummer
    – O.Gum
    Commented Nov 12, 2018 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.