Question : MS Access - Loop through code based on form value

I need a solution where a user can type in value such as 1,2,3,4,5,6,7, etc. into a form field. Next  I need it to loop through the code this amount of times. I am pasting the code below for your review.

Many Thanks!

Private Sub Command5_Click()
Dim strMsg As String


Me.Refresh
Forms!pfrm_Change_Branch_Date.Refresh

If IsNull(Forms!pfrm_Change_Branch_Date!txtChangeDate) Then
   
    Beep
    strMsg = ("Please enter date greater than current mail receive date to continue!")
    Response = MsgBox(strMsg, vbOK, "Information?")

Exit Sub

End If

If (Forms!pfrm_Change_Branch_Date!txtChangeDate) < Forms!frm_PRE_APPROVAL_PROCESS_3!BRANCH_SENT_DATE Then

    Beep
    strMsg = ("Please enter date greater than current mail receive date to continue!")
    Response = MsgBox(strMsg, vbOK, "Information?")
   
Exit Sub

End If



    DoCmd.OpenQuery "QRY_DELETE_TMP_BENEFICIALS"
    DoCmd.OpenQuery "QRY_DELETE_TMP_SIGNATORIES"
    DoCmd.OpenQuery "QRY_DELETE_PHC_CORP"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DIRECTORS"
    DoCmd.OpenQuery "QRY_DELETE_TMP_REFERRING"
    DoCmd.OpenQuery "QRY_DELETE_TMP_OTHRS"
    DoCmd.OpenQuery "QRY_DELETE_ACCOUNT_DUPLICATION"
    DoCmd.OpenQuery "QRY_DELETE_DEF"
    DoCmd.OpenQuery "QRY_DELETE_ABC"
    DoCmd.OpenQuery "QRY_DELETE_BO_NOTE"
    DoCmd.OpenQuery "QRY_DELETE_BO_DDCC"
    DoCmd.OpenQuery "QRY_DELETE_DDCC_BO"
    DoCmd.OpenQuery "QRY_DELETE_SIG_REKEY"
    DoCmd.OpenQuery "QRY_DELETE_TMP_SIG"
    DoCmd.OpenQuery "QRY_DELETE_SIG_NOTES"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DIR_NOTES"
    DoCmd.OpenQuery "QRY_DELETE_DIR_REKEY"
    DoCmd.OpenQuery "QRY_DELETE_DDCC_DIRECT"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DIRECT"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DDCC_PHC"
    DoCmd.OpenQuery "QRY_DELETE_TMP_PHC_NOTES"
    DoCmd.OpenQuery "QRY_DELETE_TMP_PHC"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DDCC_PHC"
    DoCmd.OpenQuery "QRY_DELETE_PHC_REKEY"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DDCC_REF"
    DoCmd.OpenQuery "QRY_DELETE_TMP_REF"
    DoCmd.OpenQuery "QRY_DELETE_TMP_REF_REKEY"
    DoCmd.OpenQuery "QRY_DELETE_TMP_REF_NOTES_DUP"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DDCC_OTHR"
    DoCmd.OpenQuery "QRY_DELETE_TMP_OTHR"
    DoCmd.OpenQuery "QRY_DELETE_TMP_OTHR_REKEY"
    DoCmd.OpenQuery "QRY_DELETE_TMP_OTHR_NOTES_DUP"
    DoCmd.OpenQuery "QRY_DELETE_TMP_REFERRING"
    DoCmd.OpenQuery "QRY_DELETE_TMP_DDCC_SIGS"

   
    'Inserts Beneficial Owners into TMP_ACCOUNT_BENEFICIALS
    DoCmd.OpenQuery "QRY_MAX_BENEFICIALS"
   
    'Inserts Signatories into TMP_SIGNATORY
    DoCmd.OpenQuery "QRY_EXTRACT_SIGNATORY"
     
    'Inserts DIRECTORS into TMP_ACCOUNT_DIRECTORS
    DoCmd.OpenQuery "QRY_EXTRACT_DIRECTORS"
     
    'Inserts PHCs into TMP_PHC
    DoCmd.OpenQuery "QRY_EXTRACT_PHC_CORP"
   
    'Inserts Referring into TMP_REFERRING
    DoCmd.OpenQuery "QRY_EXTRACT_REFERRING"
   
    'Inserts OTHER into TMP_ACCOUNT_OTHERS
    DoCmd.OpenQuery "QRY_EXTRACT_OTHERS"
   
    'Inserts Account for TBL_PRE_APPROVAL_PROCESS
    DoCmd.OpenQuery "QRY_ACCOUNT_DUPLICATE_BRCH"
   
    'Reinserts Account back to TBL_PRE_APPROVAL_PROCESS
    DoCmd.OpenQuery "QRY_RETURN_CLONE_ACCOUNT"
   
    '***************************************************************************************************************
    'Developer - Kirk McLeod
    'February 17, 2006
    'Title - Adding the functionality to duplicate the Due Diligence Potential Loop
    '***************************************************************************************************************
   
    'The Due Diligence Benefical Owner Duplication Phase
    'DoCmd.OpenQuery "QRY_INSERT_DDCC_BENEFICIALS"
   
    'Original code: Starts Here! ************************************************************************************
    '****************************************************************************************************************
   
    'Open the Max ID pop-up form
    DoCmd.OpenForm "pfrm_MAX_ACCOUNT_ID"
   
   
    'Update the key in TMP_DDCC_BENEFICIALS
    'DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_BENEFICIALS"
   
    'Update Beneficial Key to Max Account ID
    DoCmd.OpenQuery "QRY_UPDATE_TMP_BENEFICIALS"
   
   
    '****************************************************************************************************************
    '4132007 START DUPLICTION OF NOTES and CHECKS
    '****************************************************************************************************************
   
   
    'Beneficial Owners Notes and Checks
    DoCmd.OpenQuery "QRY_DDCC_BENE_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_BENE"
   
    'Signatory Notes and Checks
    DoCmd.OpenQuery "QRY_DDCC_SIG_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_SIG"
   
    'Director Notes and Checks
    DoCmd.OpenQuery "QRY_DDCC_DIRECT_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_DIRECT"
   
    'PHC Notes and Checks
    DoCmd.OpenQuery "QRY_DDCC_PHC_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_PHC"
   
    'Ref Notes and Checks
    DoCmd.OpenQuery "QRY_DDCC_REF_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_REF"
   
    'OTHR NOTES And Checks
    DoCmd.OpenQuery "QRY_DDCC_OTHR_TMP"
    DoCmd.OpenQuery "QRY_UPDATE_TMP_DDCC_OTHR"
   
   
   
    '****************************************************************************************************************
    '4-19-2007 COMPLETE NEW CODE
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
   
    'Update Signatory Key to Max Account ID
    DoCmd.OpenQuery "QRY_UPDATE_TMP_SIGNATORIES"
     
    'Update PHC Key to Max Account ID
    DoCmd.OpenQuery "QRY_UPDATE_TMP_PHC"
     
    'Update DIRECTORS Key to Max Account ID
     DoCmd.OpenQuery "QRY_UPDATE_TMP_DIRECTORS"
     
    'Update REFERRING Key to Max Account ID
     DoCmd.OpenQuery "QRY_UPDATE_TMP_REFERRING"
     
    'Update OTHERS Key to Max Account ID
     DoCmd.OpenQuery "QRY_UPDATE_TMP_OTHERS"
   
    'Insert rekeyed Beneficial Owners in TBL_ACCOUNT_BENEFICIALS
    DoCmd.OpenQuery "QRY_NEW_BEN_KEY"
   
    '04182007 NEW DUPLICATE NOTES CODE***********************************
    '********************************************************************
    '********************************************************************
   
    'Beneficial Notes and Checks Duplication
    DoCmd.OpenQuery "QRY_DELETE_TMP_BO_NOTES"
    DoCmd.OpenQuery "QRY_LOAD_NEW_BO_KEY"
   
   
   
    'Beneficials
    DoCmd.RunMacro "mcrRunCodeBO1"
    DoCmd.RunMacro "mcrRunCodeBO2"
    DoCmd.OpenQuery "QRY_INSERT_BO_DUP_NOTES"
   
    'Insert rekeyed Signatories into TBL_ACCOUNT_SIGNTRS_POA
    DoCmd.OpenQuery "QRY_REKEYED_SIGNATORY"
   
    '4192007 Signatories Notes and Checks
   
    'Signatory Notes and Checks Duplication
    DoCmd.OpenQuery "QRY_DELETE_TMP_SIGS_NOTES"
    DoCmd.OpenQuery "QRY_LOAD_NEW_SIG_KEY"
   
     'Signatorys
    DoCmd.RunMacro "mcrRunCodeSig1"
    DoCmd.RunMacro "mcrRunCodeSig2"
    DoCmd.OpenQuery "QRY_INSERT_SIG_DUP_NOTES"
   
   
    'Insert rekeyed PHC
    DoCmd.OpenQuery "QRY_REKEYED_PHC"
    'PHC Notes and Checks Duplication
    DoCmd.OpenQuery "QRY_LOAD_NEW_PHC_KEY"
    DoCmd.RunMacro "mcrRunCodePHC1"
    DoCmd.RunMacro "mcrRunCodePHC2"
    DoCmd.OpenQuery "QRY_INSERT_PHC_DUP_NOTES"
   
    'Insert rekeyed DIRECTORS
    DoCmd.OpenQuery "QRY_REKEYED_DIRECTORS"
   
    'Directors
    DoCmd.OpenQuery "QRY_LOAD_NEW_DIR_KEY"
    DoCmd.RunMacro "mcrRunCodeDir1"
    DoCmd.RunMacro "mcrRunCodeDir2"
    DoCmd.OpenQuery "QRY_INSERT_DIR_DUP_NOTES"
   
   
    'Insert rekeyed REFERRING
    DoCmd.OpenQuery "QRY_REKEYED_REFERRING"
   
    'Ref Notes and Checks Duplication
    DoCmd.OpenQuery "QRY_LOAD_NEW_REF_KEY"
    DoCmd.RunMacro "mcrRunCodeRef1"
    DoCmd.RunMacro "mcrRunCodeRef2"
    DoCmd.OpenQuery "QRY_INSERT_REF_DUP_NOTES"
   
     
   
    'Insert rekeyed OTHERS
    DoCmd.OpenQuery "QRY_REKEYED_OTHERS"
   
    'OTHR Notes and Checks Duplication
   
    DoCmd.OpenQuery "QRY_LOAD_NEW_OTHR_KEY"
    DoCmd.RunMacro "mcrRunCodeOTHR1"
    DoCmd.RunMacro "mcrRunCodeOTHR2"
    DoCmd.OpenQuery "QRY_INSERT_OTHR_DUP_NOTES"
   
   
   
If IsFormOpen("pfrm_Change_Branch_Date") = True Then
    DoCmd.Close acForm, "pfrm_Change_Branch_Date", acSaveNo
End If

End Sub

Answer : MS Access - Loop through code based on form value

After your update about x86 & x64, looks like you are not running 32 bit on both.  Hence, the data guard set up is not possible.
Following is from Oracle documentation.
Ref: http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/standby.htm#i72053
=============================================================================
All members of a Data Guard configuration must run an Oracle image that is built for the same platform.

For example, this means a Data Guard configuration with a primary database on a 32-bit Linux on Intel system can have a standby database that is configured on a 32-bit Linux on Intel system. However, a primary database on a 64-bit HP-UX system can also be configured with a standby database on a 32-bit HP-UX system, as long as both servers are running 32-bit images.
============================================================================
Random Solutions  
 
programming4us programming4us