You can use the .SQL property of the QueryDef object based on your query to edit the number that comes after TOP:
In your VBA procedure you would then use the Replace() function to update the .SQL property to the new number:
Code:
Dim qdf as DAO.QueryDef,sSQL as String
Dim sExistingTop as String
Set qdf=CurrentDb.QueryDefs("qryYourQuery")
sSQL=qdf.SQL
sExistingTop= Trim(Replace(Left(sSQL,InStr(sSQL,"tblProductionSchedule.SerialNumber")-1),"SELECT ","")) 'TOP 12 in your exmple
sSQL=Replace(sSQL,sExistingTop,"TOP " & Me.txtNewTopNumber) 'uses a textbox one the form to pass the new number, you can use another method such as an input box
qdf.SQL=sSQL 'update the query
Set qdf=Nothing
Cheers,