Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Very simple (I think) form..

    Hey guys,


    Here is a snippet of the form I am making. I am trying to make it as simple as possible. It is built on its own table [T_Nicknames]. This is used so that mailing that go to a customer come from a salesperson's common name, instead of his official name that is in our system.
    Click image for larger version. 

Name:	Screen Shot 2014-10-14 at 4.39.02 PM.png 
Views:	21 
Size:	18.8 KB 
ID:	18389
    The desired workflow for this form would be a user selects the store, then a salesperson (the salesperson drop down is built a query that will only show salespeople at the store that is selected), the first and last names get populated via a dlookup to our live database, then the user types in the nickname they want to use. Everything works great now, except 1 thing. Say a salesperson, Anne, (code: AA1234) already had a nickname put in. A customer brings in one of the mailers and her name was spelled incorrectly. Currently, when a user selects something from the drop, the program is creating a new record. I would rather it search to see if AA1234 has a record first. If the record exists, edit that one. If it doesn't exist, create a new one.

    I know of other ways I could accomplish this, but I am trying to keep the front end as simple as possible.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Do NOT use dlookup for the record. (slow and cumbersom)
    Do:
    the form is connected to a table
    then the user picks the person, FILTER the data on the form

    me.filter = "[emp] = ' " & cboEmpcode & "'"
    me.filteron = true

    It will show existing record, not add new ones.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Why are you using a separate table for the nickname? Would it be easier to just add a nickname field in the main employee table?

    If you are using the dropdown as a search value, don't bind it to the EmpCode field, otherwise you will get unwanted changes to your data. Use the code that Ranman256 shows to find the record you want to edit (After Update event of the combo box).

  4. #4
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Quote Originally Posted by John_G View Post
    Why are you using a separate table for the nickname? Would it be easier to just add a nickname field in the main employee table?

    If you are using the dropdown as a search value, don't bind it to the EmpCode field, otherwise you will get unwanted changes to your data. Use the code that Ranman256 shows to find the record you want to edit (After Update event of the combo box).
    The main employee table format is not editable. The nickname table is in the same program that all of our market is done through.

    I will try the code from ranman. Thanks for the help!

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

Similar Threads

  1. Simple Searchable Form
    By glennib in forum Forms
    Replies: 3
    Last Post: 07-11-2013, 09:56 AM
  2. Simple Form - Problems
    By Nibbles in forum Forms
    Replies: 4
    Last Post: 12-11-2012, 08:33 AM
  3. Simple Search form
    By Juliano in forum Forms
    Replies: 2
    Last Post: 11-25-2010, 12:38 AM
  4. simple form problem
    By kcsun in forum Forms
    Replies: 0
    Last Post: 08-12-2010, 12:28 AM
  5. Lookup Form (should be simple)
    By joshlee in forum Forms
    Replies: 3
    Last Post: 05-06-2009, 12:04 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