battling to retain key variable value in Form "ADD"

I have table1 which has a field called “userID”
I call a Form which shows all the values for userID since I have made the SQL WHERE statement to userID=’[userID]’
Let’s assume for this userID=‘12345’
When I click on “Add” in the form, I need to keep the value of userID (ie: 12345)
But it keeps on making userID blank. How do I maintain the value of userID when inserting a new record?

In field UserID Asign to field the initial value. [userID]

I do when calling the application right in the beginning.
So far the only way I seem to be able to get around it, is to have another public variable established in the AfterInsert
Thus in AfterInsert I have $savedUserID=[savedUserID]