Results 1 to 4 of 4
  1. #1
    Grahamiwa is offline Novice
    Windows 98/ME Access 97
    Join Date
    May 2011
    Posts
    6

    Information not transferring between tables

    I have an Inventory and Sales database built from a template I found.
    Inventory is recorded in an Inventory Transactions table with fields for product and quantity.
    Sales are recorded in a sales detail table with similar fields.
    When I enter a sale through the Sales Detail sub form it is not recorded in the Inventory Transaction table.
    In design view the detail in the event tab for both product and quantity is all blank.
    I looked at the Visual Basic and there are 2 procedures listed for product and quantity.
    On changing the After Update to [Event Procedure] I end up with a Visual Basic compile error User-defined type not defined.

    I can't seem to get a photo off my phone onto this post so excuse any typing errors.

    The procedures are identical except for their name.

    Private Sub Combo6_AfterUpdate()



    Dim IT As InvenyoryTransactions
    IT.ProductID = Me ! [Product ID]
    IT.Quantity = Me ! [Quantity]
    IT.AllOrNothing = True
    IT.InvenyoryID = Nz(Me ! [Inventory ID],NewInventoryID)

    In the debugger the IT As InventoryTransactions is highlighted.
    I have the Inventory Transactions table name exactly as in VB but it still fails.

    What can I do to get this working?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Access does not have a datatype called InvenyoryTransactions.
    Here is an M$oft reference to datatypes with Access.

    I have responded to your other post with some suggestions that apply here as well.
    Good luck.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    I can't seem to get a photo off my phone onto this post so excuse any typing errors.
    just copy and paste your code, then use the code tags (highlight the pasted code and click the # button). Always better to copy/paste/code tag - much easier for users to respond and more importantly, avoids typo's.

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    It appears that you don't have your UDT (User Defined Type) defined.
    You can put it in an existing code module or create a new one. If new, name it mdlMyType.
    You need this at the top of the code module:

    Code:
    Option Compare Database
    Option Explicit
    
    Type InventoryTransactions
        ProductID as long
        Quantity as long
        AllOrNothing as boolean
        InventoryID as long
    End Type
    However, without seeing your DB, I don't know if just correcting this error will accomplish your end goal of adding the record data. You probably need to post the DB here for analysis.
    Last edited by davegri; 11-03-2019 at 09:26 AM. Reason: clarif

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

Similar Threads

  1. Duplicate information in my tables and queries
    By TheSpecialist in forum SQL Server
    Replies: 2
    Last Post: 06-14-2016, 08:35 PM
  2. Form Information from multiple tables.
    By Homegrownandy in forum Access
    Replies: 1
    Last Post: 08-27-2015, 05:20 AM
  3. Replies: 3
    Last Post: 07-24-2015, 06:39 AM
  4. VBA Code to Input Information between Tables
    By SWG in forum Programming
    Replies: 4
    Last Post: 01-23-2013, 02:53 PM
  5. Updating information in the tables
    By jamilian in forum Database Design
    Replies: 1
    Last Post: 02-17-2010, 08:46 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