Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 53
  1. #16
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901

    Something along these lines should work

    Code:
    Private Sub Form_Current()
    If IsNull(Me.txtCErt) Then
        Me.txtCErt.Locked = False
    Else
        Me.txtCErt.Locked = True
    End If
    
    If IsNull(Me.txtDate) Then
        Me.txtDate.Locked = False
    Else
        Me.txtDate.Locked = True
    End If
     
    
    End Sub

  2. #17
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Bingo, It worked. I must have forgot to put End If on the second one or something. Thank you for all your help! Ive got one last piece to finish and this thing should be done!

  3. #18
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome; good luck with your project.

  4. #19
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Another Question

    I already have a section in the form where you select an Issue, and then the next box populates options that you click. I want to try and continue this a third time.

    Type --> Issue --> Main Issue

    Code:
    Combo49: SELECT Issues.Type FROM Issues GROUP BY Issues.Type; 
    Combo51: SELECT Issues.Detail FROM Issues WHERE (((Issues.Type)=Forms!FmInitial!Combo49)) ORDER BY Issues.Detail; 
     
    List84: SELECT Type.Category FROM Type GROUP BY Type.Category;
    List86: SELECT Type.IssueDetail FROM Type WHERE (((Type.Category)=Forms!FmInitial!List84)) ORDER BY Type.IssueDetail;
    Code:
    Private Sub List84_AfterUpdate()
        Me.List86 = vbNullString
        Me.List86.Requery
    End Sub
    Combo49&Combo51 are already in the form in a different section. The above code is the rowsource I am using. You can see in the attachment the Table for the information and the levels of the form. Notice how it condenses information for the 1st teir but doesn't for the 2nd and I would like it too. And then I can't get the code right to populate the DetailType for Issues-->Systems, Process....

  5. #20
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'm not sure if this has anything to do with your issue, but why are you using an aggregate query (GROUP BY) for for List84:

    List84: SELECT Type.Category FROM Type GROUP BY Type.Category;

    Why not just use:
    SELECT DISTINCT Type.Category FROM Type ORDER BY Type.Category

    Also, what is the purpose of Me.List86 = vbNullString in the after update event of list 84?

  6. #21
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I was following a sample given on a help site...

    ...what would you suggest to get this to work?

  7. #22
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You might check out Roger's site and look up his cascading combo box example. The principles should be the same as you continue cascading.

  8. #23
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    His site showed just as much as what I had, doesn't help with adding a 3rd box

  9. #24
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The principle to adding a third should be equivalent to adding a second one. It is hard to diagnose the problem without the form itself, so can you post a copy of your database? I would recommend running a compact & repair and then zip the file prior to attaching it. Make sure to remove any sensitive data before posting. Alternatively, you could create a new database and import (File-->Get External Data-->Import) everything from your original database (except the data). To do that you would go into the options under the table section and check definition only.

  10. #25
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I will post the table and a form with the cascading as I have it right now. Give me a couple minutes.

  11. #26
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Let me know if this attachment works. I included the 3rd combo box I am trying to get working and the table the information is linked too. Hope this is helpful in helping me!

  12. #27
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I noticed that you did not reference the combo box's name properly in the after update event. Also, I added the DISTINCT key word in the query for the second combo box. The amended DB is attached.

  13. #28
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    You are amazing. I was having trouble getting the VB Code to not repeat titles. Just for my reference, is it the VB code that prevented the repetativeness or the actual source code?

  14. #29
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    It is the row source property of each combo box where you control the values being supplied to each combo box. The row source is essentially a query. All I did was add the word DISTINCT after the word SELECT. The SELECT DISTINCT will only select unique values.

  15. #30
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Gotcha. So then what I was orginally trying to do would have worked if I had used SELECT DISTINCT for all. I will be creating more databases soon, so all this information has been very helpful and I think you greatly. My next big step is to split the database to front and back end so everyone doesn't have access to the tables. Right now I have it set that the only way to access the full database is to use Shift to open, but that is very easy to override.

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

Similar Threads

  1. Fields not Linking to Table
    By jlclark4 in forum Forms
    Replies: 2
    Last Post: 12-20-2010, 08:04 AM
  2. BE / FE new table linking
    By jordanturner in forum Access
    Replies: 3
    Last Post: 10-22-2010, 10:48 AM
  3. need help - combobox controls table?
    By RedGoneWILD in forum Programming
    Replies: 15
    Last Post: 09-07-2010, 04:50 PM
  4. Table linking
    By emccalment in forum Access
    Replies: 7
    Last Post: 01-28-2010, 03:51 PM
  5. Replies: 1
    Last Post: 02-05-2009, 04:53 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