Doesn't sound like a structure I would build. Why would the search form need to incorporate a subform? I have given you all the guidance I can with the examples provided. You need to attempt code to suit your db structure and form behaviors.
Doesn't sound like a structure I would build. Why would the search form need to incorporate a subform? I have given you all the guidance I can with the examples provided. You need to attempt code to suit your db structure and form behaviors.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you sir for help. i'm attaching sample database for analysis. with above code, i unable to ride over the problem. plz check it sir.
Sample LoanAPP.zip
There is a lot about this data structure I don't understand.
Why is BS_Date in Date table a text field and not date/time? What is purpose of this table?
Date is reserved word and should not be used as a name for anything.
You have a combobox on Cash forms for selecting Loan. Why do you need Search form? If you want the combobox to allow selecting by typing the loan name, then change to either hide the LoanID column or move it after the loan name in the query and set the BoundColumn to 2. Maybe change the ORDER BY to LoanName.
I see you have attempted the suggested code. Why doesn't it work? What happens - error message, wrong results, nothing?
Why is the Search form opened by Cash Debit form in KeyDown event? It doesn't have the OpenArgs value "debit".
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I'm from nepal. BS(Bikram Sambat) is nepali Date which is not recognized by Access. Access is based on AD date but i need AD date as well as BS Date so why i have used Text formate for BS Date. Through Date Table BS Date recognized. in which AD date belongs to BS Date. If i used BS Date field as Date/Time i can't fill 30/02/2071(BS Date) becasue AD date have not 30th on Febury. but in BS Date(Nepali Date) it have 30 days on 2nd month which is called Jesth month.
Date is also reserved name although it is fulfilling my desire .
I have used combo box for selection loan type because there are many type of loan facilities. there is also Manual_Account for client. only with combination of loanID and Manual_Account Client Identity fiend. i have used Account no for combination of LoanID and Manual_Account(e.g. Loan ID 2J and Manual_Account 76/01 then account No be 76/012J(which is hidden). i need Search form because there are a lot of customer having Manual_Account and hard to remember. some time client also forget their Manual_Account and also there loan type, so search form needed.
Yes, i have tried suggested code only on Cash Credit form but no thing happens. I have tried only on Cash Credit form so there are no OpenArgs on Cash Debit form.
Thank You.
Cash Credit form RecordSource has 3 tables with INNER JOIN, this requires data in all tables for records to display. Don't use INNER JOIN. There is no need for the Client and Limit tables in the RecordSource. The Limit table is in RecordSource for the subform. The subform RecordSource is a GROUP BY (aggregate) query. Aggregate queries are not editable. Why are you using GROUP BY?
The Relationshp builder shows a join between Limit Table to itself, also Txn List to itself. Why are you joining tables to themselves? Date table is shown twice but only one is linked. OutstandingBal is not linked to anything. I tried deleting the extra tables from the Relationships but Txn List_1 and Limit Table_1 came back. This is odd.
I still don't understand why you want the Search form. If you run this on a Txn List existing record, you will change the data in LoanID field. The combobox shows all available LoanType records, just pick from the list.
The OpenArgs is not working because the code is behind the subform but the form that is called to open is Search, not search subform, so need to reference OpenArgs of Search:
Private Sub LoanID_DblClick(Cancel As Integer)
If Me.Parent.OpenArgs = "Cash Credit" Then
Forms![Cash Credit]!LoanID = Me.LoanID.Value
Forms![Cash Credit]!Manual_Account = Me.Manual_Account.Value
ElseIf Me.Parent.OpenArgs = "debit" Then
Forms![Cash Debit]!LoanID = Me.LoanID.Value
Forms![Cash Debit]!Manual_Account = Me.Manual_Account.Value
End If
DoCmd.Close acForm, "Search"
End Sub
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank You Sir, It is working when i tried in sample Database.
I don't no why Txn List and Limit Table have relation with itself. i also tried to delete them but automatically it comes back again.
Outstandingbal is query so it has no relation with other.
I don't need aggregate query on subform so i will change it.
Thank You