Dlookup Query

  • Thread starter die_laffin via AccessMonster.com
  • Start date
D

die_laffin via AccessMonster.com

Hi

I'm having a bit of a problem with this Dlookup:

If DLookup("[Company Ref]", "Main", "[Company Ref] ='" & Forms!
[frmUpdateClaim]![Company Ref] & "' and [Registration Number] ='" & Forms!
[frmUpdateClaim]![Registration Number] & "' and [Settled] ='" & -1) Then

I get error:

Syntax error in string in query expression '[Company Ref] ='12345' and
[Registation Number] = 'b111bbb' and [Settled] ='-1'.

The Dlookup function worked ok before I tried to add in the "settled" part:

If (DLookup("[Company Ref]", "Main", "[Company Ref] ='" & Forms!
[frmUpdateClaim]![Company Ref] & "' and [Registration Number] ='" & Forms!
[frmUpdateClaim]![Registration Number] & "'")) Then

"Settled" is not on the form, I am just trying to check the value of this
Yes/No field in the "Main" table and open different forms based on the result.


Any assistance would be gratefully appreciated,

Thanks
die_laffin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top