Open with Link Criteria and Columns in Datasheet

  • Thread starter Thread starter Sash
  • Start date Start date
S

Sash

I have two questions. First, how do you order columns in a datasheet view?
I tried to order them in the query and on the form, but neither seem to
change the column order.

Next, I'm trying to open a form "frm_CSearch" where the data in the field
"Search" is LIKE whatever is keyed in on the form "MainSearchText". Below is
what I thought would work:

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_CSearch"

stLinkCriteria = "[Search] like *" & Me!MainSearchText & "*"
DoCmd.OpenForm stDocName, , , stLinkCriteria

My error is syntax error (missing operator) in query expression '[Search]
like *mesh*'
 
Sash said:
I have two questions. First, how do you order columns in a datasheet view?
I tried to order them in the query and on the form, but neither seem to
change the column order.

Next, I'm trying to open a form "frm_CSearch" where the data in the field
"Search" is LIKE whatever is keyed in on the form "MainSearchText". Below is
what I thought would work:

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_CSearch"

stLinkCriteria = "[Search] like *" & Me!MainSearchText & "*"
DoCmd.OpenForm stDocName, , , stLinkCriteria

My error is syntax error (missing operator) in query expression '[Search]
like *mesh*'


The pattern operand needs to be in quotes:

stLinkCriteria = "[Search] like ""*" & Me!MainSearchText &
"*"""

so the where condition ends up looking like:

[Search] Like "*mesh*"
 
Back
Top