I am currently working on a PO form for our company and have run into a bit of a snag. I have one one database with two tables that populate a list of vendors and a list of PO #'s.
On the form is a Get PO button that connects to the databse, gets the first available PO # that is available, updates the record to in use and addes a unique ID # (generated off the curren time of when the button was clicked) and then does another connection to the same database to get the PO where the # = to that of the unique ID.
Here is my problem. With the data connection, you get those prompts about this file is attempting to access the following database. If you click yes to them (first when the doc opens - two more come up when clicking the Get PO button) the form works exactly as intended. No problems
Now if you check the box to remember this choice, and click yes to any of them, the PO # no longer gets displayed in the box. The database is being updated properly, but the subsequent connection with the select statement does not work.
I have added the files as trusted sources with the same results. The only way the database is update and the number is displayed is if all data connection prompts are clicked yes each and every time.
Any help would be appreciated. If it is needed I can update this post with the code I am using, but I am thinking this is more of a settings issue somewhere than it is with my code.
It looks like I figured out the cause, and it only sort of had to do with the security prompts. Apparently, the second connection was occuring before update was completing in the access database. The only reason it would work when clicking the prompts was it allowed an extra second or so for the update to happen, then run the check to get the next number. I somewhat adjusted for this by putting a timeout in the code, which I dont really like, but even a delay of 500 milliseconds makes it work.