I am using the following code with a button on my switchboard
It is supposed to prompt the user for a number (in this case a receipt number) and then parses the reciept number to the report and prints out the duplicate receipt. However I have tried many variations and get either a syntax error or it repeats the most current receipt.
I would appreciate it if someone could help me fix this code please
Dim MyValue As Variant
MyValue = InputBox("Type in the receipt number, to be printed.", "Print a duplicate receipt")
If MyValue = "" Then
MsgBox "The duplicate receipt is cancelled."
DoCmd.OpenReport "dupreceipt", acViewNormal, , "ReceiptNo = MyValue"