query not working in 2007 access

J

jillm

We switched our 2003 Access program to a 2007 Access program and are trying
to run a query to find an address or name but the search doesn't work. Only
can find the search in 2003. Seems to be a sorting issue? Is there somewhere
in 2007 that I need to click to turn on the query function?
 
J

Jerry Whittle

I'm confused. Are you running a query or using the Find button to search for
records? Maybe filter by form?

If using a query, please show us the SQL. Open the query in design view.
Next go to View, SQL View and copy and past it here.
 
J

jillm

When I go to design view I can't get to sql to copy anything to show you.
All we are doing is we have a database of names and addresses and trying to
do a query on "last name or street address" When we press requiery, nothing
comes up in 2007 Access program. If we use the 2003 version it will show the
query.
 
J

Jerry Whittle

Can't get to SQL mode? Hummmm. Open the query in design view. Make sure that
you are on the Query Tools Design tab.

Next go up to the Office Button. Just below it should be the "Results" box.
Click on the little down triangle below the word View. Select SQL View.
 
J

jillm

Seems the only way I can get to the Query Design tab is go to "create" and
then hit query design tab and then sql view. It won't let me copy or paste
anything though so I can send it? What am I doing wrong? Thanks for your help.
 
J

Jerry Whittle

Highlight the text in SQL view. Then right click on it to bring up Copy
OR do a Ctrl + c. That copy the SQL statement to the clipboard.
 
J

jmf

txtAddressLike.Value, "") <> "" Then
filterString = _
"UCase(CustomerServiceFormsByAddress.RequestedByAddress) LIKE
'*" & _
UCase(Replace(Me.txtAddressLike.Value, "'", "''")) & "*'"
End If
If Nz(Me.txtLastNameLike.Value, "") <> "" Then
If filterString <> "" Then
filterString = filterString & " AND "
End If
filterString = filterString & _
"UCase(CustomerServiceFormsByAddress.RequestedByLastName) LIKE
'" & _
UCase(Replace(Me.txtLastNameLike.Value, "'", "''")) & "*'"
End If
Me.Form.Filter = filterString
Me.Form.FilterOn = True
End Sub

Private Sub Form_Load()
If Not IsNull(Me.openArgs) Then
Dim addrFilter As String
addrFilter = Left(Me.openArgs, InStr(Me.openArgs, Chr(9)) - 1)
Me.txtAddressLike.Value = addrFilter
Dim nameFilter As String
nameFilter = Mid(Me.openArgs, InStr(Me.openArgs, Chr(9)) + 1)
Me.txtLastNameLike.Value = nameFilter
Me.Form.Filter = _
"UCase(CustomerServiceFormsByAddress.RequestedByAddress) LIKE
'*" & Replace(addrFilter, "'", "''") & "*' AND " & _
"UCase(CustomerServiceformsByAddress.RequestedByLastName) LIKE
'" & Replace(nameFilter, "'", "''") & "*'"
Me.Form.FilterOn = True
End If
End Sub
 

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

Top