Results 1 to 4 of 4
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Changing the selection of employees in a combo box and their specified meetings

    In the db that I have attached to this post I think that I have completed my db. There are some inconsistencies that I am now addressing.

    The pdf file attached allows one to select from a list of employee names. When they do that an email address called txtemailaddess is selected and appears in the
    textbox labeled email address. Then going slightly further down to the MeetingID box one can see the meetings that each employee can attend.



    Each employee can theoretically attend all the meetings. So each employee's selection of meetings should be the same. Of course, in reality an employee
    would only go to a subset of meetings. Right now all of the meeting consist of only 4 meetings. For each employee see each of the 4 meeting listed in a sequence; not
    necessarily 1-2-3-4or 4-3-2-1. There a many combinations. In fact there are 4! factorial combinations. So no one should be put off that while all of the meetings are there for each employee,
    there all seems to have a different sequence of meetings for each employee. Why this change in sequence, I do not know.

    Anyway as one is running down the meetings for Boris Karloff, it will become obvious the once all meetings have been shown that the employee's names changes to the next in tblPersonnel and that sequence of meetings begins. While in the employee name Boris Karloff, If one keeps pressing next then the next employee is Bela Lugosi, and if one keeps pressing previous then the previous employee is Christopher Lee.

    I do not want this to happen. I want the list to stop once the sequence of meetings for Boris Karloff is exhausted. I do not want it switching to Bela Lugosi or Christopher Lee. We are discussing Boris Karloff and no one else. It does seem to me to be very professional if it switches to Bela Lugosi once I exhaust all of Boris Karloff's meeting; instead it should stop. The same should occur if I keep pressing previous and suddenly find myself in the employee name of Christopher Lee and his meetings. Again it should stop once the list of meetings for Boris Karloff has been exhausted.

    How can I change the code or MS access 2010 so this happens? As one can see from using the db now it does not happen. I just want it to only stay with the current selected employee; in this particular case it would be Boris Karloff, but in the future it would be any employee in the list.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Nothing attached to your post.

    Instead of using FindRecord, apply filter criteria. So code in cboEmployeeName would be:

    Me.FilterOn = False
    Me.Filter = "FullName ='" & Me.cboEmployeeName & "'"
    Me.FilterOn = True
    Me.cboEmployeeName = ""

    If you want to prevent the NewRecord row from showing, set the form AllowAdditions property to no. Might also set AllowDeletions to no.
    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.

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Quote Originally Posted by June7 View Post
    Nothing attached to your post.

    Instead of using FindRecord, apply filter criteria. So code in cboEmployeeName would be:

    Me.FilterOn = False
    Me.Filter = "FullName ='" & Me.cboEmployeeName & "'"
    Me.FilterOn = True
    Me.cboEmployeeName = ""

    If you want to prevent the NewRecord row from showing, set the form AllowAdditions property to no. Might also set AllowDeletions to no.
    I am confused by the number of quotes double and single n the line:

    Code:
    Me.Filter = "FullName ='" & Me.cboEmployeeName & "'"
    Anyway what exactly are they and how many are there?


    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    The apostrophes are delimiters for text type parameter because FullName is a text type field. This defines a text value as opposed to a date or number.

    The quote marks define literal text. The expression is concatenating literal text with variable.

    If you count you should have 2 pairs of quotes and 1 pair of apostrophes. These must always be used in pairs, just as parentheses ( ) and brackets [ ] must be in pairs.

    Sometimes apostrophes and quotes can be interchanged. In a query most will use quote marks to define text parameter for filter criteria although the apostrophe will work. Example:

    SELECT * FROM tablename WHERE somefield = 'some value here';

    So when constructing statements in VBA, the quotes define limits of the sql string and apostrophes define the text filter parameter. Example:

    Set rs =CurrentDb.OpenRecordset ("SELECT * FROM tablename WHERE somefield = 'some value here';")

    Date/time type use # to delimit parameters. Numbers do not require delimiter.
    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. Filter Former Employees out of Combo Box List
    By millerprm in forum Access
    Replies: 3
    Last Post: 10-29-2014, 10:28 AM
  2. Changing Form's displayed Sub-Form by Combo-Box selection.
    By IncidentalProgrammer in forum Forms
    Replies: 4
    Last Post: 09-16-2014, 01:53 PM
  3. Replies: 5
    Last Post: 04-09-2014, 06:57 PM
  4. Replies: 1
    Last Post: 09-01-2013, 09:44 PM
  5. Categorizing meetings and tasks
    By tostgulen in forum Programming
    Replies: 3
    Last Post: 01-24-2013, 06:58 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