Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookUp on Report not working 1

Status
Not open for further replies.

debbieg

Technical User
Dec 2, 2002
190
US
I am wanting a checkbox marked if the person is a first time participant.

I created a query to see who has attended which works fine.

Then as the control source on my checkbox in my report I have the following:

=DLookUp("[SSN]","qselSumAcadFirstTime","[SSN] <> " & [SSN])

I am not getting any checks on my report.

I figure I missing something very simple but just can't see it.

Thanks,
Debbie
 
=DLookUp("[SSN]","qselSumAcadFirstTime","[SSN] <> " & [SSN])

not to sure about the <>" & part of the statement but try a quote inside the last bracket
=DLookUp("[SSN]","qselSumAcadFirstTime","[SSN]<>"& [SSN]")


 
HI,
Is it possible that the text box name you are using is the exact name of a field in your "Field List"? It needs to have a different name, e.g., txtCheck.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
I get a syntax error if I add the " you suggested.

I'm wanting a checkmark if the person is NOT in the the query.

I tried changing the <> to = to see if I got a checkmark and still no checkmarks.

 
Hi,
What is the name of the field on the report? Does that match up with a field name in your "field list"?

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Hi,
You actually need an IIF statement to determine if the value is true or not. If true, you want to set the value of the checkbox to "checked"

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Randy,

The text box name was SSN and the name of the field is SSN. I changed the text box name to txtSSN. I tried:

=DLookUp("[SSN]","qselSumAcadFirstTime","[SSN] <> " & [SSN])
and
=DLookUp("[SSN]","qselSumAcadFirstTime","[SSN] <> " & [txtSSN])

Neither one worked.

Thanks so much for trying to help me.
 
Hi,
From the first post, you indicated that you want a checkmark. To use this, you really need a checkbox control rather than a text box. Now a checkbox control is unique, in that it uses two basic properties: checked and unchecked (essentially boolean true or false). So, your code will need to use an IIF statement, which will determine if something is true or not. It true, then set the property of the check box to "checked".

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Randy,

The name of the field on the report is SSN.

I tried:

=IIf(DLookUp("[SSN]","qselSumAcadFirstTime","[SSN] <> " & [SSN]),-1,0)

Still no checkmarks. Weird, huh?

Debbie
 
Hi,
Here is some code I placed in the OnFormat event of my test report:
If COUNTY_NUMB = "02" Then
Check16 = True
Else
Check16 = False
End If

I tested it, and works perfectly. Only county #2 gets a check mark.


HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
OOOPs,
That is the OnFormat event of the Detail section where my counties are listed.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Hi,
Try this in the OnFormat event of the Detail section where you want the check mark to appear:

If DLookUp([SSN],"qselSumAcadFirstTime",[SSN] <> [SSN]) then
chkFirstTime = True
else
chkFirstTime = False
End If

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Randy,

Works like a charm! Thanks so much!!!!!

Thanks for sticking with me on this.

Debbie
 
Hi,
Sorry for not catching the whole picture earlier. It feels like Friday to me right now. By the way, I have a sample database that is free. It includes a homemade login screen, homemade menu system, plus alot more features. Just send me your email address, and I will be glad to send to you. It is 2.1MB in zipped format.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top