converting access to sql server

B

BB

Hi,

I have converted data from access to sql server. In one of my forms I
am using the method i.e DoCmd.DoMenuItem A_FORMBAR, A_EDITMENU, 10, ,
A_MENU_VER20. Conversion went fine but, now when I do a search, page
just hangs. I even tried to convert docmd.doMenuItem to
DoCmd.RunCommand acCmdFind but, i still the get the same thing. Any
suggestions are appreciated.

here is the code:
Private Sub Button111_Click()
On Error GoTo Err_Button111_Click

DoCmd.RunCommand acCmdFind


Exit_Button111_Click:
Exit Sub

Err_Button111_Click:
MsgBox Error$
Resume Exit_Button111_Click

End Sub

Thanks in advance,
BB
 
R

Rick Brandt

BB said:
Hi,

I have converted data from access to sql server. In one of my forms I
am using the method i.e DoCmd.DoMenuItem A_FORMBAR, A_EDITMENU, 10, ,
A_MENU_VER20. Conversion went fine but, now when I do a search, page
just hangs. I even tried to convert docmd.doMenuItem to
DoCmd.RunCommand acCmdFind but, i still the get the same thing. Any
suggestions are appreciated.

here is the code:
Private Sub Button111_Click()
On Error GoTo Err_Button111_Click

DoCmd.RunCommand acCmdFind


Exit_Button111_Click:
Exit Sub

Err_Button111_Click:
MsgBox Error$
Resume Exit_Button111_Click

End Sub

Thanks in advance,
BB

When you move to a server back end the built in Find tools pretty much have
to be abandoned as they will scan the entire table to find the matching
results. Use filters instead which will be sent to the server for
processing.
 
B

BB

So, does that mean I have to take out "find" functionality from the form and
users has to filter the record based on their search?

Thanks,
BB
 
B

BB

Another question, is it possible to give user a button like find where they
can enter their search criteria.

Thanks,
BB
 
R

Rick Brandt

BB said:
So, does that mean I have to take out "find" functionality from the
form and users has to filter the record based on their search?

Filtering is always more efficient than searching and in a client server
situation that is greatly magnified (so yes).
 
R

Rick Brandt

BB said:
Another question, is it possible to give user a button like find
where they can enter their search criteria.

Sure. Just open an InputBox to get their filter value into a variable and
then use code...

(for strings)
Me.Filter = "FieldName = '" & InputVariable & "'"
Me.FilterOn = True

(for numbers)
Me.Filter = "FieldName = " & InputVariable
Me.FilterOn = True

(for dates)
Me.Filter = "FieldName = #" & InputVariable & "#"
Me.FilterOn = True

I usually do stuff like this with a small button right next to the field
being searched.
 

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