troubleshooting Question

Access Dlookup on current record

Avatar of Mike Rudolph
Mike RudolphFlag for United States of America asked on
Microsoft OfficeMicrosoft AccessMicrosoft Applications
17 Comments1 Solution2318 ViewsLast Modified:
Dear Experts,

I have a report that prints one record. I use this filter:

[tblStdD] = Forms!frmStudent!txtStudentID

Use the value in the variable ShowGD to determine whether or not a text box shows on the report. I use a checkbox on the form to toggle a value in the tblStdGD field in the tblStudent table. When I check the box on the form the value in the field adjusts appropriately. The problem is that for some reason the value is not registering correctly on the report.

Dim ShowGD As Boolean

ShowGD = Nz(DLookup("tblStdGD", "tblStudent"), 0)

Me!txtGuideReading.Visible = ShowGD

When I use a message box to display the value I get '0' regardless of the value in the tblStdGD field.

MsgBox "Value = " & Nz(DLookup("tblStdGD", "tblStudent"), 0) , vbInformation, " Test"

Not sure why I am not getting the right value.
Join our community to see this answer!
Unlock 1 Answer and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros