![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm using the DCount function in VBA. I need some other pair of eyes to locate my problem in the WHERE clause portion. Below is one statement of the code: rec2("PR") = DCount("[PN]", strProgram, _ "([PROC] = " & "BUYIH" & " Or [PROC] = " & "BUY" & " Or [PROC] = " & "BUYDS" & ") AND ([PO#PR] Like " & "G" & " & " & "*" & ")") So, basically I want a count of PN from a table where PROC is equal to BUYIH, BUY, or, BUYDS AND PO#PR is like G and *. Any help is appreciated. After looking at it for awhile, the obvious don't stick out. Thanks. |
#3
| |||
| |||
|
|
I'm using the DCount function in VBA. I need some other pair of eyes to locate my problem in the WHERE clause portion. Below is one statement of the code: rec2("PR") = DCount("[PN]", strProgram, _ * * * * "([PROC] = " & "BUYIH" & " Or [PROC] = " & "BUY" & " Or [PROC] = " & "BUYDS" & ") AND ([PO#PR] Like " & "G" & " & " & "*" & ")") So, basically I want a count of PN from a table where PROC is equal to BUYIH, BUY, or, BUYDS AND PO#PR is like G and *. Any help is appreciated. After looking at it for awhile, the obvious don't stick out. Thanks. |
#4
| |||
| |||
|
|
On Mar 13, 6:18 pm, whiz <whizdogbo... (AT) gmail (DOT) com> wrote: I'm using the DCount function in VBA. I need some other pair of eyes to locate my problem in the WHERE clause portion. Below is one statement of the code: rec2("PR") = DCount("[PN]", strProgram, _ "([PROC] = " & "BUYIH" & " Or [PROC] = " & "BUY" & " Or [PROC] = " & "BUYDS" & ") AND ([PO#PR] Like " & "G" & " & " & "*" & ")") So, basically I want a count of PN from a table where PROC is equal to BUYIH, BUY, or, BUYDS AND PO#PR is like G and *. Any help is appreciated. After looking at it for awhile, the obvious don't stick out. Thanks. strWhere = "[PROC] IN ('BUYIH','BUY','BUYDS') AND " & _ "([PO#PR] LIKE 'G' OR " & _ " [PO#PR] LIKE '*')" rec2("PR") = dcount("[PN]", strProgram, strWhere) |
#5
| |||
| |||
|
|
So, basically I want a count of PN from a table where PROC is equal to BUYIH, BUY, or, BUYDS AND PO#PR is like G and *. |
![]() |
| Thread Tools | |
| Display Modes | |
| |