I have a form that asks a user for a number (5 digits). I have an "on enter" macro that needs to check for an existing record. If an existing record is found, a different form will open and be populated with a table that is filtered with the 5 digit number. Or else it will open a separate form for user to input info to create a record for the 5 digit number.
I am getting a 2001 error when macro runs. I have attached a screen shot of the macro.
Any ideas would be greatly appreciated!
Code:IF (DCount("[tiw_program_#]","[tbl_programs]","[tiw_program_#]=" & "[txtProgramQuery]")>0)