I need to store a query value ( this is a max(fieldname) from a table) into a global variable. the field name is an autonumber in a table. On a form i have a textbox and I want the value of that textbox to be my global variable. then i want to create a query with a new field, and the field to be the valule of my textbox. How can I do this in VBA? I appreciate all of your assistance.

I'm using MS Access 2007 on a Windows XP machine.