Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    Here is a copy of my DB

    Here is a copy of my DB.
    PurchasesDB.zip

  2. #17
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    Here is copy of my DB. I have zipped the file

    Andy49,
    I have zipped the DB file and it is attached. Please look at it and tell me where I went wrong!
    Attached Files Attached Files

  3. #18
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    Here is a zipped format of my DB

    Here is a copy of my DB file.
    PurchasesDB.zip

  4. #19
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    a copy of my zipped DB file

    I have been trying to upload and attach my DB file to this reply. I hope this works now!
    Attached Files Attached Files

  5. #20
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    a copy of my zipped DB file

    a copy of my zipped DB file
    Attached Files Attached Files

  6. #21
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    Here is a copy of my DB

    Quote Originally Posted by andy49 View Post
    Try zipping your file nkb then upload it
    a copy of my zipped DB file:

    PurchasesDB.zip

  7. #22
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    I have been trying to reply with the zipped DB file but unsuccessful!

    Quote Originally Posted by andy49 View Post
    Try zipping your file nkb then upload it
    I have been trying to reply with the zipped DB file but unsuccessful! Maybe at a later time

  8. #23
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30
    I apologize. I have been attaching my zipped DB file for a few times mistakenly. I was not seeing my reply with the attachment. Finally, I saw it at the last page. Once again I apologize for this. I am learning from my mistakes.

  9. #24
    Mayer is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    4
    Hello
    try sql = "SELECT tblPurchasesDetails.* FROM tblPurchasesDetails WHERE (((tblPurchasesDetails.PurchaseID)=[Forms]![frmPurchasesReview]![cboPurchaseID]));"

  10. #25
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    solved?

    PurchasesDBv11.zip

    Let me know if this is OK

  11. #26
    Mayer is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    4
    just add a blue line.
    Because your sub form is linked with main form by [PurchaseID], so the record in main form should move according to cboPurchaseID value


    Private Sub cboPurchaseID_AfterUpdate()
    Dim strSQL As String


    Me.Recordset.FindFirst "[PurchaseID] = " & Me!cboPurchaseID
    strSQL = "SELECT tblPurchasesDetails.*, tblShoppingMaterials.Desc, tblShops.ShopName"
    strSQL = strSQL & " FROM tblShops INNER JOIN (tblShoppingMaterials INNER JOIN tblPurchasesDetails ON tblShoppingMaterials.ItemID = tblPurchasesDetails.ItemID) ON tblShops.ShopID = tblPurchasesDetails.ShopID"
    strSQL = strSQL & " WHERE (((tblPurchasesDetails.PurchaseID)=" & Me.cboPurchaseID & "));"


    Debug.Print "strSQL =" & strSQL


    Me!sbfPurchasesDetailsSubFormView.Form.RecordSourc e = strSQL ' "qryLineItems"
    Me.sbfPurchasesDetailsSubFormView.Form.Requery


    End Sub


  12. #27
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30
    Mayer,

    Thank you very much. It finally worked!. Now, please explain to me why this blue line made the difference and solved the problem. I do not understand the logic behind it. I put the blue line in the code and it worked. Then I removed it for testing and it did not work. Magic!!.

    Andy49 thank you for the help.

  13. #28
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30
    Mayer,

    For testing purposes, I removed the following two entries in the subform property sheet and left them blank, and the cbo and subform worked fine. No change. Why? What is going on? How is this working in Access.
    The two entries are:
    Link Master Fields: (empty)
    Link Child Fields: (empty)

  14. #29
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'm not experienced enough to say whether these are the reasons NKB but my two observations from your database are that your main form wasn't bound to a table and that you had no relationships set up so the wizard wasn't able to set anything up successfully.

  15. #30
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30
    Mayer,

    In addition, I removed the requery line: Me.sbfPurchasesDetailsSubFormView.Form.Requery
    and it is working OK. All I need now is an explanation for this to make sense to me!! I hope you can help.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-19-2017, 05:05 AM
  2. Replies: 1
    Last Post: 03-02-2016, 08:04 AM
  3. Replies: 6
    Last Post: 02-23-2016, 01:45 PM
  4. Replies: 4
    Last Post: 12-29-2014, 01:53 PM
  5. Replies: 3
    Last Post: 11-04-2012, 09:25 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