Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131

    get value on form from another form

    suppose i have three form. 1. Credit txn 2. debit txn 3. search
    all form contain loan id and account no field.
    when i press F3 key search form opened.

    i want


    when i am using credit txn, i press F3 key and open Search form
    when i double click on Search field search form should be closed and double clicked fields Loan Id and Account no should be filled in Credit TXn
    and
    same should be happen with debit txn also.

    Can it is Possiple
    Thank You.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    It's possible but maybe you should just use a combobox to select Loan.
    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.

  3. #3
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    I do not unterstand sir. Can you please describe in details?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Combobox (a 'dropdown' list) is basic Access functionality. Use it to limit values that can be selected for entry. This provides a list of know values for users to choose, in your case, Loans. Access Help has guidelines on creating a combobox that creates the dropdown list from a table. Also, review:

    http://www.datapigtechnologies.com/f...combobox1.html

    http://www.datapigtechnologies.com/f...combobox3.html
    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.

  5. #5
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    Thanks for help but i don't want to use combobox. i want to retrieve value from another from called search after double click in releted field.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Why don't you want to use combobox? Passing data between independent forms involves more work. However, if you must, options:

    1. Code behind the Credit and Debit forms to 'pull' values from Search form.
    Me.LoanID = Forms!Search.LoanID

    2. Code behind the Search form to 'push' values to other forms.
    Forms!CreditTXN!LoandID = Me.LoanID

    The real trick is figuring out what event to put the code in and timing of code execution.

    Combobox much simpler.
    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.

  7. #7
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    I don't want to use Conbobox because it takes lot of time to find a/c no.
    in search form i have design as like where i can filter a/c no by name or address and other so that a/c no can be find soon
    you have advice be to code behind forms but i don't understand where to put these code.
    Thank You

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Like I said, the real trick is figuring out what event to put the code in. Without knowing more about your db structure and form behaviors, hard to be specific. I can give you an example from my code:

    Code:
    ...
    'user prompt for entry of logout date
    DoCmd.OpenForm "DialogGetDate", , , , , acDialog, "Logout"
    If CurrentProject.AllForms("DialogGetDate").IsLoaded Then
        Me.tbxDate = Form_DialogGetDate.tbxDateDialog
        DoCmd.Close acForm, "DialogGetDate", acSaveNo
    End If
    ...
    That is just small part of a lengthy procedure that is called by a button Click event.


    Why do you say it takes so long to find a/c number with combobox? The AutoExpand property should make it quite easy and fast.
    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.

  9. #9
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    because i have to find their a/c no by name because client forget their a/c no, some time by Proprietor name so i think combobox can't fulfill my desire.
    I do not understand your code.
    should I have to send sample database for analysis?
    Thank You

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Combobox can be set up as multi-column where the name is entered and as the user types, the dropdown list will show the name and a/c number. I think that is demonstrated by the second link I referenced earlier.

    There is actually more to the process than the code I already posted. The code opens a form called DialogGetDate and pulls the user entered date from that form. The form is opened in dialog mode which suspends code execution from the calling form. Then there is code behind the dialog form that hides the dialog form which causes the code in the calling form to resume execution. Here is code that is behind the dialog form:
    Code:
    Private Sub tbxDateDialog_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        If IsNull(Me.tbxDateDialog) Then
            MsgBox "Enter date."
        Else
            If Me.OpenArgs = "Logout" Then
                'Check if logout date falls within billed accounting period
                If Nz(DLookup("Final", "AcctgPeriod", "EndDate>=#" & Me.tbxDateDialog & "#"), 0) = True Then
                    MsgBox "Date is within a finalized accounting period.  Enter another date.", vbOKOnly, "DateError"
                    Me.tbxDateDialog = Date
                    Exit Sub
                End If
            End If
            Me.Visible = False
        End If
    End If
    Me.tbxDateDialog.SetFocus
    End Sub
    Code for you could be simply:

    code behind Credit form to open search form:

    Sub Button1_Click()
    DoCmd.OpenForm "Search", , , , , , "credit"
    End Sub

    code behind Debit form to open search form:

    Sub Button1_Click()
    DoCmd.OpenForm "Search", , , , , , "debit"
    End Sub

    code behind Search form:

    Sub Button1_Click()
    If Me.OpenArgs = "credit" Then
    Forms!Credit!LoanID = Me.LoanID
    Forms!Credit!AccountID = Me.AccountID
    ElseIf Me.OpenArgs = "debit" Then
    Forms!Debit!LoanID = Me.LoanID
    Forms!Debit!AccountID = Me.AccountID
    End If
    DoCmd.Close
    End Sub

    That's about as specific and simple as I can get it for you. Adapt code as needed for your situation.
    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.

  11. #11
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    for sample i have described only 3 forms but in actual i have 50-60 forms. Should i have to repet (ElseIf Me.OpenArgs = "debit" Then
    Forms!Debit!LoanID = Me.LoanID
    Forms!Debit!AccountID = Me.AccountID) this code 50 -60 times ?
    or i have to code another ways?

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Yes, with this example, would have to repeat the statements 50 to 60 times. That's a lot of forms. Why are there so many? And they all open this Search form?

    There are other methods, such as my other example code.
    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.

  13. #13
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    because i design separate form for separate work and many of form needed loan ID and Account no.
    and search form is design for search loan id and account no (Client identity).
    Thank You

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    "Separate form for separate work" means nothing to me. What is 'separate work'? Are these forms identical? Maybe you should just be applying a filter to a single form instead of building 50 forms.
    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.

  15. #15
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    just as For cach transaction i'm using Cash credit and cash debit form, for journal trancation i'm using journal credit and journal debit form, for a/c closing i'm using a/c closed form and for interest calculatin for a/c i'm using intacclosed form, for interest received i'm using interest received form and form int calculation int form is used, for emi(End month instalment) i'm using emi for and for interest calculation intemi form is used and so on.
    and one think sir,
    in above question, i'm using subform in search form and all form are opening in dialog mode.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-01-2013, 04:23 PM
  2. Replies: 2
    Last Post: 11-13-2012, 02:11 PM
  3. Replies: 6
    Last Post: 09-02-2012, 04:30 PM
  4. Replies: 1
    Last Post: 06-09-2012, 05:44 PM
  5. Replies: 9
    Last Post: 02-15-2011, 03:05 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