Results 1 to 11 of 11
  1. #1
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29

    Subform records wont display

    Hi it's me again. One problem solved another problem found..



    I have a subform which contains dated notes about a customer.

    These notes display fine if you cycle through the customers using the record selectors but stops working when i navigate to a customer using my search function.

    For some reason the subform does not refresh to match the newly searched customer.

    Im just gunna uplaod my database so you can have a look at how the notes section works.

    The image ive uploaded demonstrates the section you need to be looking at.

  2. #2
    sasipulikkal is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2009
    Posts
    3
    Hi..

    I assume,with the click of search,u need to display the notes of the client.Depending on the Client u have searched,the records need to be displayed in the dated notes.rite?
    Can u please write the code,what you have used now?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In order for a MainForm/SubForm to stay in sync, the LinkChild/MasterFields properties need to have values that match.

  4. #4
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29
    Hi,

    Yeah i have linked the notes and clients using the ClientID.


    here is my search code

    Private Sub Command3_Click()

    On Error GoTo Err_Command3_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    If Me.List3.ListCount > 0 Then
    stDocName = "frmClients"
    stLinkCriteria = "[ClientID]=" & Me!
    [List3]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    DoCmd.Close acForm, "frmSearchClient2", acSaveNo
    DoCmd.Close acForm, "frmSearchClient1", acSaveNo
    Else
    DoCmd.Close acForm, "frmSearchClient2", acSaveNo
    End If

    Exit_Command3_Click:
    Exit Sub

    Err_Command3_Click:
    MsgBox Err.Description
    Resume Exit_Command3_Click

    End Sub
    Last edited by taylorosso; 09-27-2009 at 01:39 AM.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your explaination is not in what you posted in post #1.

  6. #6
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29
    sasipulikkal asked for any code so I gave him my code...

    I am not using any other code related to the clients and notes.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Based on what you posted in Post #1, the SubForm with the notes will not stay in sync because the LinkChild/MasterFields do not contain the same values.

  8. #8
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29
    ok, I set the link child master field values to "company name" and they still wont sync when i use the search.

    When cycling through the clients using the record selectors it syncs fine

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The tblNotes table does not have a [company name] field so how did you do that?

  10. #10
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29
    Quote Originally Posted by RuralGuy View Post
    The tblNotes table does not have a [company name] field so how did you do that?
    I created it on the db on my system,

    see attachment

  11. #11
    taylorosso is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    29
    I have had a thought,

    could it be that the my search code is finding a client record but not actualy selecting that record hence my linked subform is not showing any data?

    RuralGuy you may be able to help with that one.

    Here is the search code once again;

    Private Sub Command3_Click()

    On Error GoTo Err_Command3_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    If Me.List3.ListCount > 0 Then
    stDocName = "frmClients"
    stLinkCriteria = "[ClientID]=" & Me!
    [List3]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    DoCmd.Close acForm, "frmSearchClient2", acSaveNo
    DoCmd.Close acForm, "frmSearchClient1", acSaveNo
    Else
    DoCmd.Close acForm, "frmSearchClient2", acSaveNo
    End If

    Exit_Command3_Click:
    Exit Sub

    Err_Command3_Click:
    MsgBox Err.Description
    Resume Exit_Command3_Click

    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 08-20-2009, 07:53 AM
  2. checkboxes to display records
    By jamie123 in forum Forms
    Replies: 1
    Last Post: 05-13-2009, 10:43 AM
  3. Can I make a subform display only?
    By nkenney in forum Forms
    Replies: 4
    Last Post: 04-01-2009, 11:50 AM
  4. Report to display multiple records by date.
    By af01waco in forum Reports
    Replies: 1
    Last Post: 03-21-2009, 02:12 PM
  5. drop down wont display
    By gromit95 in forum Database Design
    Replies: 3
    Last Post: 10-21-2008, 11:12 AM

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