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

Live status needs wildcard for recordsource

Status
Not open for further replies.

PLSM

Technical User
Feb 5, 2003
7
GB
Hi.

I have a live status field with a record source: =IIf([frmJobDetails_Subform_2].[Form].[RecordSource]="*",DCount("[JobStatus]","*","[JobStatus]='Completed' AND [jobID]=[frmBackupJob_Subform].Form![RecID]"))

How do I get those wildcards to work? Any ideas?

Thanks in advance.

Brgds,
PLSM Brgds,
PSLM
 
Well - that all depends on what you mean by 'work'

=IIf([frmJobDetails_Subform_2].[Form].[RecordSource]="*",DCount("[JobStatus]","*","[JobStatus]='Completed' AND [jobID]=[frmBackupJob_Subform].Form![RecID]"))

What do you think the clause
Code:
([frmJobDetails_Subform_2].[Form].[RecordSource]="*"
should be doing ?


And WHAT do you expect DCount to do with a domain of "*" ?

The DCount Criteria clause
Code:
"[JobStatus]='Completed' AND [jobID]=[frmBackupJob_Subform].Form![RecID]"))[/
is about the only thing that makes any sense in the string provided ( Although the [square brackets] all over the place are un-necessary )


What are you wanting to do ?




G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Well, the "*" was put there to show that this is where I need a wildcard. However, I have realised that this is probably not possible. maybe this example will make more sense:

DCount("[JobStatus]","tblJobDetails" Or "qryJobDetails_Filter_Comment" Or "qryJobDetails_Filter_Today" Or "qryJobDetails_Filter_Yesterday" Or "qryJobDetails_Filter_Last3Days" Or "qryJobDetails_Filter_VariableDates" Or "qryJobDetails_Filter_Failed" Or "qryJobDetails_Filter_FailedLast3Days" Or "qryJobDetails_Filter_FailedVarDate" Or "qryJobDetails_Filter_CommentNotEmpty","[JobStatus]='Completed' AND [jobID]=[frmBackupJob_Subform].Form![RecID]")

That is what i would like to do, but can't at the moment.

PLSM Brgds,
PSLM
 
Well the first thing that I'd suggest that you do is junk all of those qryJobDetails_Filter_XXXX things

Go back to the relevant underlying table and create one SQL expression that does the work of all those queries.

One tidy expression will be a lot easier to understand and debug later .



'ope-that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
I couldn't agree with you more but unfortunately I don't have the skills to do so.. This is the easier option. Brgds,
PSLM
 
instead of

[x] = "*"

use

[x] like "*"


Hope this helps

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top