Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Kipandrews06 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    54

    Gicu, I tried the code and it gave me an error message saying "method or data member not found" for the Me.QtyOrdered. Since this is on the cmd button on the product list subform, there isn't a qtyordered field. I tried doing [forms]![frmItemCartOrdersSubform].[QtyOrdered] but it said it couldn't find referenced field. I then tried it including the main form since its all linked [forms]![frmOrderDetails]![frmItemCartOrdersSubform].[QtyOrdered] but got the same error message. Should I try an invisible dlookup txt box to reference it?

  2. #17
    Kipandrews06 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    54
    Click image for larger version. 

Name:	DBTblOrders.PNG 
Views:	10 
Size:	28.9 KB 
ID:	47331Click image for larger version. 

Name:	DBForm1.PNG 
Views:	10 
Size:	114.5 KB 
ID:	47332

    Here's a screenshot of my table and the form with the subforms.

  3. #18
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Try Me.Parent.Form.[frmItemCartOrdersSubform].Form.Controls("QtyOrdered") or
    Forms![frmOrderDetails]![frmItemCartOrdersSubform].Form.Controls("QtyOrdered")

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #19
    Kipandrews06 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    54
    Gicu, that worked and is doing exactly what I wanted, but now it is not updating. When I start a new order and click on the add button it just flashes for a sec and the message box that is supposed to pop up to say "Item Added to Cart" doesn't show. When I go to the table those products were added. I'm looking at the code and I clearly have it set to requery. I'm not sure why its not doing that step. But when I add the same product twice it combines the duplicate value with the other product so that is working perfect!

  5. #20
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Please post the entire code as you have now, I think the Me.Requery and the MsgBox needs to move outside the If statement (just checked and I forgot to add the End If in my original post).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #21
    Kipandrews06 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    54
    Actually, I fixed it. I needed to put the ELSE part under the form requery I had. So anyways, thank you so much for your help! Everything is working perfect now!

  7. #22
    Kipandrews06 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    54
    Just saw your post Gicu and you are correct. I also moved up the msgbox as well before the ELSE part.

  8. #23
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You're very welcome, see, it wasn't that hard if we approach it one step at the time !
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 15
    Last Post: 04-02-2019, 02:41 PM
  2. Replies: 3
    Last Post: 03-10-2014, 08:51 AM
  3. Preventing duplicate record
    By wpryan in forum Forms
    Replies: 2
    Last Post: 03-30-2013, 09:43 AM
  4. Replies: 2
    Last Post: 05-02-2012, 09:16 PM
  5. Replies: 1
    Last Post: 04-25-2012, 01:57 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