Results 1 to 10 of 10
  1. #1
    JGalt90 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13

    Change Field Dependencies on Form

    Hi, this issue has been posted here, usually suggesting cascading combo boxes, but I cannot get it to specifically work for my form. A change to OrderDetails_ProductID will correctly change the product name to the right product. For user friendliness I want to be able to put in the product name, and have the reverse happen (OrderDetails_ProductsID and Supplier ID change). This is the last thing holding up the DB, please help and I won't bother you people again.


    Click image for larger version. 

Name:	DBHelp10.jpg 
Views:	17 
Size:	100.0 KB 
ID:	20442
    Thank you

    -J

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Code:
    sub ProductName_afterupdate()
      [prodID]=dlookup("[prodID]","[tProducts]","[productname]=' " & [productname] & " ' "
    end sub

  3. #3
    JGalt90 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Thank you, I am having a little trouble entering this, I am very new to Macros. I went into create macro and added a submacro then pasted it.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    This isn't a macro. This is an event of the box using vba.
    the box a person enters the part name, triggers its update event ,(see properties, events tab, AFTERUPDATE.)
    then the above code fills in the part#

  5. #5
    JGalt90 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Hi, I noticed there might be a ) missing, I tried it with that and without it in the properties sheet for Product name, OrderID, and the form as a whole and no changes occurred. I also entered it into the code builder in design view.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Suggest eliminate spaces that follow and precede the apostrophe delimiters.

    And yes, ranman forgot a paren.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    JGalt90 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Hi June and thank you so much for help in previous posts. I did remove the spaces too. : 0 Sorry

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Still not working? Want to provide db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    JGalt90 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Quote Originally Posted by June7 View Post
    Still not working? Want to provide db for analysis? Follow instructions at bottom of my post.
    Hi, I have removed the DB WITHOUT the added code in the properties sheet to reduce confusion. Ideally the code would allow me to change the Product name and change the ID's. Thank you.
    BreadDB2.zip

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There is no code in this db that will change the product name or product ID in the textboxes.

    Why don't you use comboboxes for selecting product?

    Have you tried suggestion from other thread https://www.accessforums.net/forms/f...use-52097.html

    Basically duplicate topic threads.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Change Field Direction in Form
    By accessnewbie352 in forum Forms
    Replies: 5
    Last Post: 01-05-2015, 01:04 PM
  2. Form Dependencies
    By dpscott in forum Access
    Replies: 3
    Last Post: 06-18-2014, 10:10 AM
  3. Replies: 2
    Last Post: 03-17-2014, 11:51 AM
  4. Change query field in form
    By octsim in forum Queries
    Replies: 4
    Last Post: 11-04-2013, 11:12 AM
  5. Form Dependencies
    By Juan4412 in forum Forms
    Replies: 15
    Last Post: 06-20-2011, 06:40 PM

Tags for this Thread

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