Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182
    Sorry. Entire event code is below:

    Code:
    Private Sub cmbFoodInvolved_AfterUpdate(Cancel As Integer)
    
    If IsNull(DLookup("Food Involved", "tblProductAutofill", "Food Involved = '" & Me!cmbFoodInvolved.Text & "'")) Then 
    Me.txtIngredient.SetFocus
    
    Else
    Me.txtIngredient.Value = Me.cmbFoodInvolved.Column(1)
    Me.txtCategory.Value = Me.cmbFoodInvolved.Column(2)
    Me.txtCharaceteristics.Value = Me.cmbFoodInvolved.Column(3)
    Me.txtDescription.Value = Me.cmbFoodInvolved.Column(4)
    Me.txtQuantity.SetFocus
    End If
    End Sub


  2. #17
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,826
    Interesting that the code in the email is not the same as what's posted here. The email code definitely has something about it that could cause your error, but this forum doesn't indicate that you went back to edit it. So I see nothing obviously wrong, but you're not indicating how this code was placed into your form module after I wrote about how to do it. For all I know, cmbFoodInvolved is not really the name of your control, which my instructions would have eliminated the opening line as a potential problem. So you will have to compact and zip your db and post it here for me to help any further.

  3. #18
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182
    What are you referring to when you say "emai lcode"

    And you are right. I am not allowed to show the actual database. (At least I could possibly get into trouble.) As such, I have been using different names. I will see what more I can do. I do appreciate all of your help and time however.

  4. #19
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,826
    I'm afraid I permanently deleted the forum notification email. It had something like
    Me.txtIngredient.SetFocusElse
    Else

    If you cannot mock up a sample by removing all the unnecessary tables, queries, reports, private info etc. then I don't know what else I can do. It sounds like maybe we're not even using the correct names for controls involved in the procedure.
    Good luck.

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

Similar Threads

  1. Replies: 5
    Last Post: 12-29-2016, 03:04 PM
  2. run code from text box
    By Jen0dorf in forum Access
    Replies: 6
    Last Post: 11-13-2015, 02:59 PM
  3. Replies: 3
    Last Post: 04-22-2014, 11:11 AM
  4. Converting a Code to Text
    By rmcafee in forum Programming
    Replies: 7
    Last Post: 09-13-2011, 08:52 PM
  5. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 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