Thanks uncle Gizmo for your kind help.
It will be working fine some points you mentioned i need to explore how and what need to be mentioned, little things need to change.
However, I will be using this from (frmEditBankEntry) to open many form based on each check box selected like i have frmBankTransferEntry for Bank Transfer Check box, frmDepositsEntry, frmChequeEntry, frmStandingOrdersEntry etc, for which i need to modify it to accommodate all these forms opening to be treated in same way because the field name is same in all forms, which is cboSelectBank for BankAccount and cboEntryNo for EntryNo.
i could put some code like as you mentioned on command button
While opening rest of the form it need some sort of accommodation and linking of fields in public function that you suggest for which i dont know how to add i did try something like mentioned below but it turns little bit messy need to do it properly.
It will be working fine some points you mentioned i need to explore how and what need to be mentioned, little things need to change.
However, I will be using this from (frmEditBankEntry) to open many form based on each check box selected like i have frmBankTransferEntry for Bank Transfer Check box, frmDepositsEntry, frmChequeEntry, frmStandingOrdersEntry etc, for which i need to modify it to accommodate all these forms opening to be treated in same way because the field name is same in all forms, which is cboSelectBank for BankAccount and cboEntryNo for EntryNo.
i could put some code like as you mentioned on command button
Code:
If Me.EntryType = "Bank Transfer" Then
DoCmd.OpenForm strFrmName, acNormal, , , acFormEdit, , BankAccount & ";" & EntryNo
With Forms(strFrmName)
'.prpClientID = Me.ClientID
.EditEntry
.Modal = True
'.Caption = "I CAN CHANGE THE CAPTION"
End With
Else
If Me.EntryType = "Cheque" Then
DoCmd.OpenForm strFrmName, acNormal, , , acFormEdit, , BankAccount & ";" & EntryNo
With Forms(strFrmName)
'.prpClientID = Me.ClientID
.fcboEntryNoRequery
.Modal = True
'.Caption = "I CAN CHANGE THE CAPTION"
End With
While opening rest of the form it need some sort of accommodation and linking of fields in public function that you suggest for which i dont know how to add i did try something like mentioned below but it turns little bit messy need to do it properly.
Code:
Public Function EditEntry() As String
Dim conAppName As String
Dim strSubName As String
Dim strModuleName As String
Dim ChequeEntry As String
Dim BankTransferEntry As String
Dim DepositEntryEntry As String
Dim StandingOrderEntry As String
Dim CashWithdrawals As String
Dim ATMTransactions As String
ChequeEntry = "frmChequeEntry"
BankTransferEntry = "frmBankTransferEntry"
DepositEntry = "frmDepositEntry"
StandingOrderEntry = "frmStandingOrderEntry"
CashWithdrawals = "frmCashwithdrawals"
ATMTransactions = "frmATMtransactions"
If Forms(BankTransferEntry).CurrentView <> conDesignView Then
conAppName = (s)
strSubName = EditEntryLookup
strModuleName = Functions
'strModuleName = "Module - basModuleName"'
On Error GoTo Error_Handler
'Select records based on Entry No
Me.Recordset.FindFirst "EntryNo = " & cboEntryNo
Me.cboEntryNo.Requery
Me.Refresh
If Me.Void = True Then
MsgBox "This Entry and its underline transactions are Voided before !"
End If
Exit_ErrorHandler:
Exit Function
Error_Handler: 'Version - 1a
Dim strErrFrom As String
Dim strErrInfo As String
strErrFrom = "Error From:-" & vbCrLf & strModuleName & vbCrLf & "Subroutine >>>>>>> " & strSubName
strErrInfo = "" & vbCrLf & "Error Number >>>>> " & Err.Number & vbCrLf & "Error Descscription:-" & vbCrLf & Err.Description
Select Case Err.Number
Case 0.123 'When Required, Replace Place Holder (0.123) with an Error Number
MsgBox "Error produced by Place Holder please check your code!" & vbCrLf & vbCrLf & strErrFrom & strErrInfo, , conAppName
Case Else
MsgBox "Case Else Error" & vbCrLf & vbCrLf & strErrFrom & strErrInfo, , conAppName
End Select
Resume Exit_ErrorHandler
End Function 'EditEntry