Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Not clear to me what needs to be explained. This is really basic Access functionality.

    Suggest using a form/subform arrangement. Main form bound to Staff and subform bound to Outstanding. Open main form (the subform will synchronize) and go to desired staff record, enter records in subform.



    Create form/subform http://office.microsoft.com/en-us/ac...010098674.aspx

    One way to filter form records http://datapigtechnologies.com/flash...tomfilter.html
    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.

  2. #17
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    Thank you for your reply. I have follow your sending link instruction. However, it is unable to success to do it(datapigtechnologies.com) . I am unable to display staff record. Here I attached the file I modified the file. Please help. Thanks.
    Attached Files Attached Files

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The combobox used to enter search criteria must be UNBOUND. You do not have code in the combobox AfterUpdate event. The form RecordSource is not a parameterized query. Review the video again and follow the design.

    Alternative to parameterized query is:

    Me.Filter = "StaffID=" & Me.myselector
    Me.FilterOn = True

    You have not fixed the primary/foreign key situation noted in posts 5 and 7.
    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.

  4. #19
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    I am apologised for different file I sent it. Here is corrected file I did.
    Attached Files Attached Files

  5. #20
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Need to set combobox properties:

    RowSource: SELECT Staff.StaffNumber, Staff.LastName & ", " & Staff.FirstName AS StaffName, Staff.TeamCode FROM Staff WITH OWNERACCESS OPTION;

    ColumnCount: 3

    ColumnWidths: 0";1.5";1"

    Code in combobox AfterUpdate event is Me.Requery but you are not using a query as the form RecordSource. If you review the DataPig video you will see that the form uses a parameterized query as its RecordSource.

    Alternative to parameterized query is this code:

    Me.Filter = "StaffNumber='" & Me.myselector & "'"
    Me.FilterOn = True
    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.

  6. #21
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    Thank you for your reply. I have tried to follow your instruction. However, Last name, First name, team code are not changable when the combo box value change. And also when I tried to change to design view. It said the changes you requested to the table were not successful because they would create duplicate value in the index.


    Please help.

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I downloaded your db again. Did the following changes:

    Set myselector combobox properties:

    RowSource: SELECT [Staff].[StaffNumber], [Staff].[LastName & ", " & [Staff].[FirstName] AS StaffName, [Staff].[TeamCode] FROM [Staff];
    ColumnCount: 3
    ColumnWidths: 0";1.5";1"

    Code for the combobox:

    Private Sub myselector_AfterUpdate()
    Me.Filter = "StaffNumber='" & Me.myselector & "'"
    Me.FilterOn = True
    Me.myselector = Null
    End Sub

    That's it. Do the exact same things and should work.

    What do you mean by 'are not changeable'? If you want to add a new record then must move to New Record row. All works for me. No problem adding new record. I added new staff then new record in subform.
    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.

  8. #23
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    Thank you for your reply. I followed your instruction I did exact same things. The messages were coming up. I attached some pictures for your reference. Thanks.

    Click image for larger version. 

Name:	error1.jpg 
Views:	3 
Size:	71.7 KB 
ID:	13462
    This picture is when the combo box changed, the staff information (Last name, First name & Team code) did not work.

    Click image for larger version. 

Name:	error2.jpg 
Views:	3 
Size:	84.2 KB 
ID:	13463

    This picture is when it changed to Design View the message was coming up.

    Please Help!!

  9. #24
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Then the db is different from the one I worked with and/or you really have not done what I did.

    Provide db with YOUR edits I will try to figure out why different behavior.
    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.

  10. #25
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    O.K I am apologzied for this situation. I dont know why.Here is file I attached. Please have a look. Thanks.
    Attached Files Attached Files

  11. #26
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The myselector combobox must be UNBOUND - no ControlSource.

    Controls used to input search criteria must be UNBOUND, otherwise you change the data in the record.
    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.

  12. #27
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    Thank you for your reply. I have tried to follow your instruction. However, the record does not change when changing the combo box. So. What can I do?

  13. #28
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I just downloaded your db again. I removed StaffNumber from the myselector combobox ControlSource so it is UNBOUND. That's it, everything works. Can't get any simpler.
    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.

  14. #29
    Mahou is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    22
    Thank you for your reply. here is picture I show you what issue is. Thanks. Click image for larger version. 

Name:	error3.jpg 
Views:	4 
Size:	80.3 KB 
ID:	13470

  15. #30
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Did you do what I said to fix the combobox? Did you open form in design view and delete StaffNumber from the ControlSource property?

    As I said, I did only that one change to your database and the form works properly. There's nothing else I can do to help you.
    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.

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

Similar Threads

  1. Related Record Required
    By ungratefulninja in forum Database Design
    Replies: 7
    Last Post: 11-02-2012, 10:21 AM
  2. Replies: 3
    Last Post: 08-21-2012, 01:10 PM
  3. Replies: 7
    Last Post: 07-02-2012, 10:50 PM
  4. Go To Record with related table Primary Key
    By jamiebull21 in forum Forms
    Replies: 3
    Last Post: 02-17-2012, 09:36 AM
  5. ...related record required...
    By degras in forum Forms
    Replies: 11
    Last Post: 11-03-2011, 12:20 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