Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2015

    Unanswered: Dlookup is not working in Navigation Form

    I have a form frmBusDriver where Dlookup works fine and shows me a DriverName but since I have connected the form to a Navigation form it doesn't show me a driverName.. Please see the screenshot and help me what Am I doin't wrong there...
    My dlookup is as: =DLookUp("[DriverNameAr]","[tbl1Drivers]","ID =" & Forms![frmBusDriver]!Driver_ID)
    Attached Thumbnails Attached Thumbnails form.png  

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    What does [frmBusDriver]!Driver_ID actually contain? Insert a command button (Command_Tmp) on your form and in the event handler for its Click event, insert these lines:
    Private Sub Command_Tmp_Click()
        Debug.Print Me.Driver_ID.Value
    End Sub
    Then re-open the form and click on the Command_Tmp button. When the code stops, open the Immediate Windows (Ctrl+G) and see what's in there.
    Have a nice day!

  3. #3
    Join Date
    Nov 2015
    No, that's not clear answer.. why would i have a command button?? And why would I click every time I open the form..
    I am asking why its not showing a driver name on Navigation form but it does show on another form while I have the same Dloockup function for both..
    Click image for larger version. 

Name:	form.png 
Views:	2 
Size:	47.4 KB 
ID:	16784

  4. #4
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    The suggestion is to debug the form. Because you are using dlookup in a control there is no easy way to debug it. So by asking you to do this Sinndho is trying to find what is in driver id.

    The #name error usually suggests you have mispellt a column or table or it is not in the current scope. To use a value from frmbusdriver it must be open at the same time
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2015
    I modify my code=DLookUp("[DriverNameAr]","[tbl1Drivers]","ID =" & Forms![frmBusDriver]!Driver_ID)


    =DLookUp("[DriverNameAr]","[tbl1Drivers]","ID =" & Forms![NavigationForm]![NavigationSubform]![Form]![Driver_ID])

    And now works showing Driver Name on the Navigation form!!!
    But I am little disappointed coz for the first time, I didn't get help from here..!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts