If Dcount Help

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have the following code. If the qryBOMAssy_C1 finds the A_ITEM then it
opens a form called frmBOMAssy_C1. I need to first tell A_ITEM what it is
and I am doing that in the stLink. How would I add that to the DCount?

Dim stDocName As String
Dim stLink As String

stDocName = "frmBOMAssy_C1"

If DCount("A_ITEM", "qryBOMAssy_C1") >= 1 Then
stLink = "[A_ITEM]=" & "'" & Me![ITEM] & "'"
DoCmd.OpenForm stDocName, acFormDS, , stLink
Else
DoCmd.OpenForm "frmPopNoBWU"
End If
 
T

tina

i'm not completely sure i followed that, but it sounds like you want to add
a criteria argument to the DCount() function. if so, try

If DCount(1, "qryBOMAssy_C1", "[A_ITEM]= '" _
& Me![ITEM] & "'") >= 1 Then

hth
 
M

mattc66 via AccessMonster.com

That worked - Thanks
i'm not completely sure i followed that, but it sounds like you want to add
a criteria argument to the DCount() function. if so, try

If DCount(1, "qryBOMAssy_C1", "[A_ITEM]= '" _
& Me![ITEM] & "'") >= 1 Then

hth
I have the following code. If the qryBOMAssy_C1 finds the A_ITEM then it
opens a form called frmBOMAssy_C1. I need to first tell A_ITEM what it is
[quoted text clipped - 11 lines]
DoCmd.OpenForm "frmPopNoBWU"
End If
 
T

tina

you're welcome :)


mattc66 via AccessMonster.com said:
That worked - Thanks
i'm not completely sure i followed that, but it sounds like you want to add
a criteria argument to the DCount() function. if so, try

If DCount(1, "qryBOMAssy_C1", "[A_ITEM]= '" _
& Me![ITEM] & "'") >= 1 Then

hth
I have the following code. If the qryBOMAssy_C1 finds the A_ITEM then it
opens a form called frmBOMAssy_C1. I need to first tell A_ITEM what it
is
[quoted text clipped - 11 lines]
DoCmd.OpenForm "frmPopNoBWU"
End If
 

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