Results 1 to 7 of 7
  1. #1
    KerryAustin is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    27

    Cascading Combo Box works in main form but not in a Navigation Page

    I have a cascading combo box that works perfectly ina main form but not in a navigation page subform. I have search and read many examples but just not having any luck getting mine to work. Here is what I have:
    a combo box: cboDept which holds 5-6 department which is the parent of a cascadinging conbo box. I then have a child combo box: cboRmNum which is associated room number for a particular department. My SQL for cboDept ROWSOURCE is SELECT [tblRm].[DEPT] FROM tblRm GROUP BY [tblRm].[DEPT]; My SQL for cboRmNum ROWSOUCE is SELECT tblRm.Rm_Num FROM tblRm WHERE ((([tblRm].[Dept])=[Forms]![FormDelay].[NavigationSubForm]![cboDept])) ORDER BY tblRm.Rm_Num;

    Here is a screenshot of my Navigation Page
    Click image for larger version. 

Name:	NavPage.jpg 
Views:	20 
Size:	234.2 KB 
ID:	17809

    I have a Form called frmDelay and the parent and child cascading combobox works as it should. Once I added it to the navigation page it failed and I get a "ENTER PARAMETER VALUE" message when I select child combo box. I have changes the WHERE CLAUSE to this following: WHERE ((([tblRm].[Dept])=[Forms]![FormDelay].[NavigationSubForm]![cboDept])). [tblRm].[Dept] gets the Department Name, tblRm.Rm gets the associated room numbers for that particular Department. Each department has about 3-7 rooms that procedures are performed in.

    I know this has been addessed may times but I am unsuccessful getting it to work for me with their suggestions.

    Thanks in advance,
    Kerry

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Review https://www.accessforums.net/forms/t...orm-32053.html

    Since the comboboxes are on same form, try omitting the form qualifier. It works on a normal form/subform.

    WHERE [Dept]=[cboDept]
    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
    KerryAustin is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    27
    I am going to play with it but that seamed to work. I also added tblRm.Dept and hid the field. It's aways the simplist least common way to do things. Thank you so much for the reply. I have been banging my head for hours. If it keep working tomorrow I'll close it out.

    Thanks again.
    Kerry

  4. #4
    KerryAustin is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    27
    Hello June 7...Your suggestion worked great. I have one other question regarding this form then I will close out. I would like to add a check box just above the textbox MRN and Assession Number and when the checkbox is check, disable MRN and Assession. Right now I have Dept, MRN and Assession Number required fields. If the checkbox is checked, disable MRN and Assession Number and go to fend of form and input delays. I have tried adding code to Form which is:

    Form's BeforeUpdate

    If Me.CheckBox Then
    If Nz(Me.MRN,"") = "" Then
    Cancel = True
    End If
    End If

    Code in AfterUpdate

    If Me.Checkbox Then
    Me.MRN.Enabled = True
    Else
    Me.MRN.Enable = False
    Me.MRN = ""
    End If

    Code in Form's Current Event

    Me.MRN.Enabled = Me.Checkbox

    This does not work, I get a message box indicating Dept, MRN and Assession is required.
    I would also Like to add additional fliers to this once I get it working.

    Thank you,'Kerry

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    What purpose does the checkbox serve? Is it bound to a field? Why should user need option to enable/disable controls?

    The code is setting MRN to an empty string. I never allow empty strings in table. I prefer Null if there is no data.

    I don't use navigation forms.
    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. #6
    KerryAustin is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    27

    Add

    My boss wants to add a special procedure room delay reason when a room is delayed that is not associated to a patient. If check box is selected then the delay is not patient related and therefore no MRN (medical record number) or As session Number (procedure number) is needed. I have MRN, Dept, and As session required because users sometimes rush to get through the form. If there is a better way, please suggest. I am currently in a development and test phase. I currently made the check box bounded. If you recommend differently I can use NULL.
    Last edited by KerryAustin; 08-20-2014 at 06:21 PM. Reason: additional reply

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    If fields are set as required in the table, disabling the controls and preventing data entry won't negate that requirement. Will still get error if try to leave record without entering required data.

    Bound is okay. This allows for code to set enabled state of controls when record is re-opened.

    So you want user to be able to check the box to disable some controls just so they won't have to tab through those controls?

    My comment about empty string and Null data has nothing to do with the checkbox.
    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. Replies: 2
    Last Post: 07-16-2014, 10:32 AM
  2. Help making navigation form/main menu
    By tmpgovrel in forum Access
    Replies: 3
    Last Post: 09-06-2013, 02:41 PM
  3. Replies: 9
    Last Post: 08-07-2012, 11:50 AM
  4. Cascading Combo from Main to Sub
    By libraccess in forum Forms
    Replies: 1
    Last Post: 07-01-2012, 01:03 PM
  5. Replies: 3
    Last Post: 10-18-2009, 09: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