Results 1 to 12 of 12
  1. #1
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39

    Table Design


    I have a table tbl_Clients with the standard fields of FirstName, LastName, etc. I also have a field ReferredBy in which I would like to draw from names of existing clients who made the referral, seems simple enough ... not so. Any help on accomplishing this (I would think) common task would be greatly appreciated.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    How many people/clients can be part of a referral? What exactly is a referral?

  3. #3
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Sorry,

    A new client may have been referred by only one existing client.
    I was hoping to have a combo pulling from existing client names (concanted fname and lname) to populate the bound ReferredBy field in a form.
    Thanks for your help

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    If you are going to keep the referredBy value, then you need a spot in the table. Since you only have 1 referrer, you can just add a field to the Client record.

    You could use used the ClientId to populate the referredBY
    You can populate the comboReferrers on the form using (untested)

    Select clientid,ClientFirstName, clientLastname from clientTable where
    clientid <> Me.clientID

    This should give you all clients except the one you are working with (Client can't refer himself/herself)

    Then in the afterupdate of the comboReferrers

    Update ClientTable
    Set ReferredBy = me.comboReferrers


    That should be the basics of it.
    Good luck.

  5. #5
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Thanks - getting there..

    cboReferredBy
    Control Source: ReferredBy
    Row Source:
    SELECT ClientID, FirstName, LastName FROM tblClients WHERE ClientID <> Me.ClientID;

    Getting: Enter Parameter Value Me.ClientID

    Where have I messed up?

    Again, thanks for your help & patience

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Try
    SELECT ClientID, FirstName, LastName FROM tbl_Clients WHERE ClientID <> Me.ClientID;

    I;m nit sure what fields are in your table and I had the namewrong.

  7. #7
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Almost there...

    cboReferredBy After Update event Compile Error
    Sub or Function not defined

    Update word in Update tblClients is highlighted. tblClients is correct name

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You have a form with a combo right?
    You go to design, combo, right click for properties,events , select code , choose after update.

    Busy at the moment
    see if this helps
    http://www.fmsinc.com/microsoftacces...xes/index.html

  9. #9
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Yes, I did all that. Still getting a compile error - sub or Function not defined

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What is the sub/function name in the error message?
    Show us all the code in the cmbo after Update event

  11. #11
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    I sure messed up. Combo spelled wrong. Working fine now. My apologies. Sorry to take up so much of your time.
    Now, how do I close this as being solved??

    Thanks again

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Glad you have it working.

    At the top of this page, click on Thread Tools.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-01-2014, 01:41 PM
  2. Replies: 3
    Last Post: 04-27-2014, 08:08 PM
  3. Table Design -- want to avoid a design that creates blank fields
    By snowboarder234 in forum Database Design
    Replies: 4
    Last Post: 10-08-2012, 10:13 AM
  4. Replies: 8
    Last Post: 03-24-2012, 11:03 AM
  5. table design: one big table vs. multiple small tables
    By lstairs in forum Database Design
    Replies: 3
    Last Post: 12-31-2009, 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