Results 1 to 6 of 6
  1. #1
    karla.uptown@gmail.com is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    3

    Opening a Form within Navigation Control

    I would like to open a form that displays a patient's information (PatientInformation_f) when I double click a patient's ID on a datasheet (part of another form).



    I can get the patient information form to open to the right record using:

    Private Sub Patient_ID_DblClick(Cancel As Integer)
    DoCmd.OpenForm "PatientInformation_f", , , "PatientID=" & Me!PatientID
    End Sub

    However, I am using Access's Navigation Controls, and I can't figure out how to get PatientInformation_f to open within the navigation. I have read many times that all forms within navigation are considered subforms and I have tried the following but it is still not working...

    Private Sub Patient_ID_DblClick(Cancel As Integer)
    DoCmd.OpenForm "Form!NavigationForm_f!PatientInformation_f", , , "PatientID=" & Me!PatientID
    End Sub

    Does anyone know how to refer to forms within the navigation control in Access 2010?

    Thanks!!!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I won't be able to look at "Access's Navigation Controls" (first I have heard about it) until tonight.
    But You have a syntax error: ""Form!" should be "Forms!" (Note the "s")
    Code:
    DoCmd.OpenForm "Forms!NavigationForm_f!PatientInformation_f", , , "PatientID=" & Me!PatientID
    If you have a button that currently opens the form "PatientInformation_f", add the same code in the double click event of the patient ID control and add the WHERE clause.

  3. #3
    karla.uptown@gmail.com is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    3
    Thanks for the response... I tried using Forms!..., but it still doesn't work.

    It says "Forms!NavigationForm_f!PatientInformation_f" is misspelled or refers to a form that doesn't exist. Since the form names are correct, I have to assume that this isn't the correct way to refer to a form within the navigation window.

    I think this code will work if I can figure out what to call the form as it sits in the navigation window. Any ideas?


    Quote Originally Posted by ssanfu View Post
    I won't be able to look at "Access's Navigation Controls" (first I have heard about it) until tonight.
    But You have a syntax error: ""Form!" should be "Forms!" (Note the "s")
    Code:
    DoCmd.OpenForm "Forms!NavigationForm_f!PatientInformation_f", , , "PatientID=" & Me!PatientID
    If you have a button that currently opens the form "PatientInformation_f", add the same code in the double click event of the patient ID control and add the WHERE clause.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Would you like to post the dB so I can look at it tonight and see the forms?

  5. #5
    karla.uptown@gmail.com is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    3
    Sure! It is attached. The code is in the patient ID field of SubFormPatientSearch_f. I am trying to open PatientInformation_f with in NavigationForm_f.

    Thanks!!!
    Attached Files Attached Files

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    can you post a sample that's 2003 or earlier. If you are referencing a subform on a main form you can't use forms!<formname>!<fieldname> same goes for referencing a main form item from a subform the referencing string is different:

    If you're referencing a subform from a main form it's something like:


    Forms!mainform!subform.Form.controlonsubform


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report not opening from navigation form
    By librarian in forum Programming
    Replies: 3
    Last Post: 08-03-2012, 11:15 AM
  2. Using Navigation Control
    By PlamenGo in forum Access
    Replies: 9
    Last Post: 04-08-2012, 01:57 AM
  3. Replies: 7
    Last Post: 11-16-2011, 01:22 PM
  4. Navigation Form control syntax 2010
    By AndycompanyZ in forum Forms
    Replies: 2
    Last Post: 06-28-2011, 07:23 AM
  5. Control Navigation Bar
    By Patrick.Grant01 in forum Access
    Replies: 0
    Last Post: 05-17-2009, 06:16 AM

Tags for this Thread

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