Results 1 to 2 of 2
  1. #1
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53

    Using Variables and/or Macros and/or VBA?


    Hi y'all,

    I have a frm_Axes and a frm_Serial_Numbers.

    In frm_Axes there is a cbo_SerNum to assign a Serial Number to an Axis. I have code so when cbo_SerNum is 2x-clicked, it opens frm_Serial_Numbers to the specified record.

    This is what I want to happen, it seems easy, but I can't figure it out. When cbo_SerNum is 2x-Clicked, I want to save the Serial Number as variable SerNumReturn and then open continue with code to open frm_Serial_Numbers to the specified record. When frm_Serial_Numbers is closed, if variable SerNumReturn is defined, open frm_Axes go to a certain record, if it is not defined, then go to another form.

    Basically, I want to go back to the last record open in frm_Axes after 2x-clicking cbo_SerNum.

    Thank you for any and all help!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You could store your variable in a global variable that resides in a Standard Module. Another option might be to pass it in Open Args, as described here
    http://www.baldyweb.com/OpenArgs.htm

    Another thing you can do is use a hidden unbound textbox in the first form and store the value there.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Macros
    By kstyles in forum Programming
    Replies: 2
    Last Post: 07-12-2011, 01:38 PM
  2. VBA variables in SQL
    By compooper in forum Programming
    Replies: 3
    Last Post: 07-06-2011, 11:04 AM
  3. VBA in variables
    By smikkelsen in forum Access
    Replies: 3
    Last Post: 11-12-2010, 03:14 PM
  4. VBA or Macros
    By mastromb in forum Forms
    Replies: 6
    Last Post: 01-03-2010, 04:46 PM
  5. sql in vb variables
    By emilylu3 in forum Programming
    Replies: 3
    Last Post: 03-04-2006, 01:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums