Results 1 to 4 of 4
  1. #1
    chimp8471 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2021
    Posts
    25

    Compare contents of 2 forms

    I have a few forms that I use as a shopping cart basket process



    Form 1. I have a search form... holds lists of parts. i double click on the part number and it pops up form 2
    Form 2. allows the user to choose the qty to be removed then the item is added to the cart form 3.
    Form 3. The Basket

    When i double click the Part Number in Form 1 and Form 2 opens.... I want it to look to see if the selected part is already in the basket form 3

    If it is make a message visible

    Can i do this? if so any pointers please

    Click image for larger version. 

Name:	Message.jpg 
Views:	23 
Size:	109.7 KB 
ID:	45350

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    If it's on form3 is it guaranteed to be in a table of cart item? Then when form3 Loads, DLookup on that table & field using criteria like Me.txtpartID=Forms!form3.txtPartID
    If DLookup returns a result, Msgbox, else do nothing.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    chimp8471 is offline Novice
    Windows 10 Office 365
    Join Date
    May 2021
    Posts
    25
    Hi,I wanted to get back to you on this sooner but just had yet another bloody knee op!! grr!!

    I am sorry for the lack of understanding, Could someone please help me with this Dlookup issues and the if bit to get the message to appear

    really appreciate the help

    If the item exists in the basket it will be in the table

    TtempPartIssued.PartNumber

    so on form load (Frm_Cartadd_item)

    Private Sub Form_Load()
    If =DLookup("Me.txtpartID=TtempPartIssued.PartNumber) ) Then (I am sure this is wrong but i can't work out what to put)
    MsgBox "Item already in cart"
    Me.LblMessage = Visible
    Else
    Do nothing (not sure what to put here)
    Me.LblMessage = Visible

    End If
    End Sub

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    If you don't know how to use DLookup, research it? There is so much info out there yet you haven't made the effort to try creating your own expression. That's the best way to learn. Without knowing your table and applicable field name it's impossible to write one for you anyway.

    https://www.techonthenet.com/access/...in/dlookup.php

    Hope your recovery goes well. I'm sure that having that done can be a painful and exasperating experience.
    Do post back if you get stuck. BTW, please post code within code tags (# on posting toolbar) and use indentation - makes it much easier to read and prevents the forum from doing weird things to your posted code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-04-2017, 09:55 PM
  2. Compare controls of two forms
    By newbieX in forum Programming
    Replies: 7
    Last Post: 10-07-2014, 09:06 AM
  3. Table of Contents
    By Alex Motilal in forum Reports
    Replies: 1
    Last Post: 09-17-2012, 10:48 AM
  4. Replies: 5
    Last Post: 04-18-2012, 12:04 PM
  5. Replies: 0
    Last Post: 03-29-2011, 04:11 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