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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkup

Status
Not open for further replies.

canett

Technical User
Jan 22, 2006
18
BG
How can i check a field in the table? I have a field called Suborder in the table orders.On the form I have also a checkbox called ChkSuborder. I want to build a code in the OnClick event of the checkbox.This event should check whether there is a field Suborder = true and if so to give out a message " you have some job undone" Obvously this code should open a recordset of the table orders but how exactly is the way to do it ?
 

You could search on help for Open Recordset method (DAO or ADO).
But I would recommend the DLookup() function as faster.
 
I know how to write the code you describe. However, first I have a question for you.

You say that you want the popup to appear if suborder=true. But suborder is a field in the table orders. That orders table could have 1000 records in it. Do you want to see the popup if ANY of them are true?

I suspect you want to look at a subset of the table orders. And if any record in that subset has subreport=true, THEN you want to see the popup. If my supposition is correct, tell us how that subset is defined.
 
I'm assuming Steve, it's a single record based on the
current record of the form?
If so, I would include the field on the form,
and invisibilze it (just had to say it, LOL).

If Me.Suborder Then ...

or Like Jerry said,

Dim blnSuborder As Boolean
blnSuborder = DLookUP("Suborder","Orders","pkiD = " & Me.PkID)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top