Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 53
  1. #31
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The SELECT DISTINCT clause forces only unique values to show. The criteria (WHERE clause) is what filters the values being supplied to the combo box based on the choice in the previous combo box. The other key is to make sure you reference the name of the combo box correctly in the After Update event of the combo box. For example, in the first combo box in your sample database, it had two statements that both referenced combo4, but combo4 was not a combo box control on the form. You have to correctly reference the next combo box in the sequence.

  2. #32
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Here's my last crazy question. How can I make the default view a new record instead of record #1?

  3. #33
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You can change the data entry property from no to yes. Then any time you open the form, it will open to add a new record. The downside is that you cannot view already existing records when the data entry property is set this way.

  4. #34
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Yeah, I knew that option, but I need the ability to still view additional records. I may just train the team to automatically click Add Record on first entry and create a new one. We will just have to see!

  5. #35
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    ...or you can present your users a selection form that has a couple of buttons ("Add New" or "Edit Existing") and change the data entry property as the form loads depending on their decision.

  6. #36
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    That my friend is a brillant idea. And I think I actually know how to do that! Up until the opening it in two different ways comes into play. We shall see.

  7. #37
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Yes, I am going to need help on this. I have the first Command button (CmdSearch) set to access the entire form to search through. The second button (CmdAddNew) needs to be set so the default is a new record. What is the best way to go about this? Below is the current VBC
    Code:
    Option Compare Database
     
    Private Sub CmdSearch_Click()
    On Error GoTo Err_CmdSearch_Click
        Dim stDocName As String
        Dim stLinkCriteria As String
        stDocName = "FmInitial"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
     
    Exit_CmdSearch_Click:
        Exit Sub
     
    Err_CmdSearch_Click:
        MsgBox Err.Description
        Resume Exit_CmdSearch_Click
        
    End Sub

  8. #38
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Using the command button wizard to open a form, you can modify the code that is generated to set the data entry property.

    So in the On Click event of the command button to open the form ready to enter a new record, the code would look like this, the only thing I added was the line shown in blue

    Code:
        
    Private Sub Command1_Click()
    On Error GoTo Err_Command1_Click
        Dim stDocName As String
        Dim stLinkCriteria As String
        stDocName = "NameOfFormToOpen"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
        Forms!NameOfFormToOpen.DataEntry = True
        
    Exit_Command1_Click:
        Exit Sub
    Err_Command1_Click:
        MsgBox Err.Description
        Resume Exit_Command1_Click
        
    End Sub
    You would have similar code behind the button to open the form to view/edit all records by just toggling the True to False

  9. #39
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Wow, simple enough. Thank you!

  10. #40
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome!

  11. #41
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I'm Back

    The database was a success. Management only had a few layout changes. Do have another question. With the combo boxes, can you set controls to become visible for only certain selections?

    I would like the Compliance to become visible only if Written or Email is selected from the Method of Reciept and Yes is checked for the Official Complaint. Is this possible? I would need Official Complaint to be visible at all times.

  12. #42
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Yes, that is possible (see attached). The only thing is that you must make sure that the user goes in the appropriate order from the first combo box to the option group selection. So it might be better to hide the option group until something is chosed from the initial combo box.

  13. #43
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I like how that looks, and I agree with the hiding of the option group until the first combo box has been selected. Thanks for your help once again!

  14. #44
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You are welcome!

  15. #45
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Hey

    I'm back again. I am trying to calculate the amount of point a question is worth based on the answer chosen in the Frame.

    For example:
    I have Frame 19 with Option 22 (Y), 24 (N) and 26 (N/A). If Option 22 is selected, I would like the 3 to appear in text574. If Option 24 or 26 are selected, I would like 0 to appear.

    In some cases, Y could equal 2 or 1 point(s).

    What should be done to get this to work? Am I overlooking something?

Page 3 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