Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56

    What is cleanest method to display a list of selected contacts on a customer form?


    I currently tried a few different things. One was bringing over an entire form as a subform. Looked ugly. So now I think a list box looks good. the trouble now is The contacts in the list box are the same for every customer. Now what am I doing wrong?[ATTACH]
    Attached Files Attached Files

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,436
    Added criteria to the listbox rowsource.
    Added embedded macro to requery listbox for form_current event.

    Customer Tracking-davegri-v01.zip

  3. #3
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    I would think the tContacts table would have a field CustID
    then the subform would be bound to the custID and only show those contacts.

  4. #4
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    davegri. First off thanks. It looks good. I understand most of it i just dont get this part "txtCustomerID" Im prompted to enter something as a parameter for the open contacts box. What do I enter here? Because no matter what i enter it just openS a list off all the contacts regardless of the customer ID.

  5. #5
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,436
    Quote Originally Posted by wcook101 View Post
    davegri. First off thanks. It looks good. I understand most of it i just dont get this part "txtCustomerID" Im prompted to enter something as a parameter for the open contacts box. What do I enter here? Because no matter what i enter it just openS a list off all the contacts regardless of the customer ID.
    Change the name of the text box.

    Click image for larger version. 

Name:	txtcustID.png 
Views:	17 
Size:	37.4 KB 
ID:	40636

  6. #6
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    It was already is named txtCustomerID. Thats was not the problem. Your macro was bad. You had "[CustomerID]=" & [txtCustomerID] it should read ="[CustomerID]=" & [txtCustomerID]
    You just forgot the = in front of the statement. I added it and now it works great.
    Which lead to a new problem. When it opens the contacts form, it doesnt allow me to add a new contact. Is that because the form is a read only or something?

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,436
    Thats was not the problem. Your macro was bad. You had "[CustomerID]=" & [txtCustomerID] it should read ="[CustomerID]=" & [txtCustomerID]
    Don't know where that come from. No such macro at all in the DB I submitted.

    Quote Originally Posted by wcook101 View Post
    It was already is named txtCustomerID. Thats was not the problem. Your macro was bad. You had "[CustomerID]=" & [txtCustomerID] it should read ="[CustomerID]=" & [txtCustomerID]
    You just forgot the = in front of the statement. I added it and now it works great.
    Which lead to a new problem. When it opens the contacts form, it doesnt allow me to add a new contact. Is that because the form is a read only or something?
    With the new problem, are you referring to your complete DB or my abbreviated DB?
    If the complete DB, have you applied my changes? If so, please upload the changed DB.
    Last edited by davegri; 01-09-2020 at 03:27 PM. Reason: expanded

  8. #8
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    Yours. Now the list box works perfectly. I just need to find out why im not allowed to add new records from the contacts form. I could before.
    Attached Files Attached Files

  9. #9
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    on contacts form Change the default =[Forms]![Contact]![CustomerID] To =[Forms]![Customer]![txtCustomerID]

    Also you should add a table for the business types and use a combobox

    mick

  10. #10
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    Thanks Mick.

  11. #11
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    Your welcome I also noticed when you open the contacts screen and add a new contact the list dont update you can do it with a update button or open the contacts form in dialog mode then requery the list.

    mick

  12. #12
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    Mick, Where on the contact form are you seeing a default value that you describe? No where on any property do i see
    =[Forms]![Contact]![CustomerID]

  13. #13
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    in the customerID Field Thats why you can't add a record

    mick

  14. #14
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,436
    Quote Originally Posted by Mickjav View Post
    Your welcome I also noticed when you open the contacts screen and add a new contact the list dont update you can do it with a update button or open the contacts form in dialog mode then requery the list.
    Or just add macro to form_activate event to requery the listbox.

    This design has a problem if you simply open the contact form from the navigation pane without the customer form open. You get an error, because the default value for customerID is from the customer form which is not open.
    This is OK if you always open the contact form from the button on the customer form.

  15. #15
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    When you are finished with the design open the options

    click current Database then untick view navigation pan also to prevent users from viewing the navigation pane untick use special keys but make sure you have a design copy backup before doing it.

    mick

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

Similar Threads

  1. Replies: 2
    Last Post: 04-24-2018, 06:25 AM
  2. Replies: 5
    Last Post: 01-06-2018, 08:09 PM
  3. how to display list of customer interactions
    By denniston in forum Forms
    Replies: 9
    Last Post: 12-06-2017, 07:30 PM
  4. Replies: 7
    Last Post: 08-06-2016, 07:05 PM
  5. Filter Contacts based on Selected Customer
    By davecumber in forum Forms
    Replies: 7
    Last Post: 07-25-2013, 06:17 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