By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Help with wherecondition and wildcards in VBA..........

P: n/a
Hello, I was wondering how to modify the Do.cmd wherecondition
statement to filter not only for RATTY name but also for the "LAST"
field that contain a "^" carrot in front of them...With the current
system a carrot is placed in front of the LAST field ie ^Smith to
denote it as signifigant and i need to pull those out of the
report....
So LAST not like "^*". what are wildcards in VBA? how is the sytax in
the do.cmd statement anyhelp will be much appreciated..Thanks Much
Private Sub Run_ATTY_Report_Click()
'this runs just attorney
Dim stDocName As String
Dim strAttyName As String
Dim strLAName As String
Dim strReportName As String
strReportName = "By_ATTY_AND_LA"

strAttyName = lstRATTY.Column(0)
strLAName = lstLEGAL_ASST.Column(0)
'MsgBox ("Atty Name = " & strAttyName & " Legal Asst. Name = " &
strLAName)

DoCmd.OpenReport reportname:=strReportName, View:=acViewPreview,
Wherecondition:="RATTY = '" & strAttyName & "'"
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gobi wrote:
Hello, I was wondering how to modify the Do.cmd wherecondition
statement to filter not only for RATTY name but also for the "LAST"
field that contain a "^" carrot in front of them...With the current
system a carrot is placed in front of the LAST field ie ^Smith to
denote it as signifigant and i need to pull those out of the
report....
So LAST not like "^*". what are wildcards in VBA? how is the sytax in
the do.cmd statement anyhelp will be much appreciated..Thanks Much
Private Sub Run_ATTY_Report_Click()
'this runs just attorney
Dim stDocName As String
Dim strAttyName As String
Dim strLAName As String
Dim strReportName As String
strReportName = "By_ATTY_AND_LA"

strAttyName = lstRATTY.Column(0)
strLAName = lstLEGAL_ASST.Column(0)
'MsgBox ("Atty Name = " & strAttyName & " Legal Asst. Name = " &
strLAName)

DoCmd.OpenReport reportname:=strReportName, View:=acViewPreview,
Wherecondition:="RATTY = '" & strAttyName & "'"


Is LAST the last name or the last entry?

Look at the LEFT() function.
Nov 13 '05 #2

P: n/a
Salad <oi*@vinegar.com> wrote in message news:<e6****************@newsread1.news.pas.earthl ink.net>...
Gobi wrote:
Hello, I was wondering how to modify the Do.cmd wherecondition
statement to filter not only for RATTY name but also for the "LAST"
field that contain a "^" carrot in front of them...With the current
system a carrot is placed in front of the LAST field ie ^Smith to
denote it as signifigant and i need to pull those out of the
report....
So LAST not like "^*". what are wildcards in VBA? how is the sytax in
the do.cmd statement anyhelp will be much appreciated..Thanks Much
Private Sub Run_ATTY_Report_Click()
'this runs just attorney
Dim stDocName As String
Dim strAttyName As String
Dim strLAName As String
Dim strReportName As String
strReportName = "By_ATTY_AND_LA"

strAttyName = lstRATTY.Column(0)
strLAName = lstLEGAL_ASST.Column(0)
'MsgBox ("Atty Name = " & strAttyName & " Legal Asst. Name = " &
strLAName)

DoCmd.OpenReport reportname:=strReportName, View:=acViewPreview,
Wherecondition:="RATTY = '" & strAttyName & "'"


Is LAST the last name or the last entry?

Look at the LEFT() function.


It is the LAST Name field
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.