I've been trying to solve this for a while, and I know the answer is easy - but I just can't seem to get it to go. I'm creating a macro that runs when data is input in a form box. The first step is to check the data (its an order number) to see if it has been used before. It has to look in a table called "closed orders" So I created a parameter query, and then a form based on that query. I want to use an if/then in the macro to take action, or not, depending on whether there is a match.
I've tried a multitude of ways and can't seem to make it work. I created a macro that opened the form with the parameter from input form. Works great. On my form I have a count box that counts how many records in a given field. Also great. Always correct. Then I set up If condition in several ways - but none works. One condition is IsNull for the count box - or any other field for that matter. When I run it I just get an "out of string space" error. No clue why. Database is not big. I'm not using fields or counts bigger than 65K.
I tried the VBA route. I was able to run the underlying query and create if then based on if there were any records. My problem in the VBA was how to run the report, and pass the parameter that the query needs.
I'm really, really frustrated. I've set up several other queries and macros. I've written some basic VBA that all seem to accomplish WAY more, but this thing is driiving me nuts!
I've tried a multitude of ways and can't seem to make it work. I created a macro that opened the form with the parameter from input form. Works great. On my form I have a count box that counts how many records in a given field. Also great. Always correct. Then I set up If condition in several ways - but none works. One condition is IsNull for the count box - or any other field for that matter. When I run it I just get an "out of string space" error. No clue why. Database is not big. I'm not using fields or counts bigger than 65K.
I tried the VBA route. I was able to run the underlying query and create if then based on if there were any records. My problem in the VBA was how to run the report, and pass the parameter that the query needs.
I'm really, really frustrated. I've set up several other queries and macros. I've written some basic VBA that all seem to accomplish WAY more, but this thing is driiving me nuts!