RE: How can i simulate the code in Macro?




no,not works
glitch

"Ofer Cohen" wrote:

Try adding a single quote for the string

Dim MyCriteria As String
MyCriteria = "[hb] Like '*" & [Forms]![searchHearB]![Ssearch] & "*' Or [de]
Like '*" & [Forms]![searchHearB]![Ssearch] & "*'"

Docmd.OpenReport "ReportName" , , , MyCriteria


--
Good Luck
BS"D


"ooxx" wrote:

Hi,

I have test the code, but it gets bugs, and I can't fix. The problem is at
the "*" when concatenated on the last of the the sentence that it should be "
to close the sentence, but I don't know how to.

Thanks,


"Ofer Cohen" wrote:

Try using code instead of a macro.
Using code you can use the Debug and step through the lines, and view each
value.

Something like

Dim MyCriteria As String
MyCriteria = "[hb] Like *" & [Forms]![searchHearB]![Ssearch] & "* Or [de]
Like *" & [Forms]![searchHearB]![Ssearch] & "*"

Docmd.OpenReport "ReportName" , , , MyCriteria

--
Good Luck
BS"D


"ooxx" wrote:

Hi all,

I need to write in procedure code when the macro is truncated the criteria.

I have two fields, and I would do in the macro on the subject of to open
report in print preview format and its where criteria as follows:
[hb] Like "*" & [Forms]![searchHearB]![Ssearch] & "*" Or [hb] Like
[Forms]![searchHearB]![Ssearch] & "*" Or [de] Like
[Forms]![searchHearB]![Ssearch] & "*" Or [de] Like "*" &
[Forms]![searchHearB]![Ssearch] Or [de] Like [Forms]![searchHearB]![Ssearch]
& "*"

I have problem to concatenate them in the code procedure.

I try from the simple but not success, the problem exists even it succeeds
in doing code format that Access can't find the field, though the fields
exists in the Report1.

Thans,
.



Relevant Pages

  • RE: How can i simulate the code in Macro?
    ... Dim MyCriteria As String ... Good Luck ... "ooxx" wrote: ...
    (microsoft.public.access.forms)
  • Re: Lookup form
    ... I realised that as my "keyfield" wasn't a string I didn't ... Good Luck ... "Tony Williams" wrote: ... 3.On clicking on one of the results it opens another form ...
    (microsoft.public.access.forms)
  • Re: Import Access Table into Excel. I appreciate your assistance. Thanks!
    ... tried merging this as well to fit yours, but still no luck. ... End Sub ... MyTableField1 As String, S1 As String, ...
    (microsoft.public.excel.misc)
  • RE: Max again
    ... "ooxx" wrote: ... Public Function fnNthLargestValue(FieldName As String, TableName As String, _ ... Dim rs As DAO.Recordset ... fnNthLargestValue = Null ...
    (microsoft.public.access.queries)
  • RE: How can i simulate the code in Macro?
    ... Is it an error or the report doesn't show the right records? ... Good Luck ... "ooxx" wrote: ... in doing code format that Access can't find the field, ...
    (microsoft.public.access.forms)