i have a table

24sharon

Registered User.
Local time
Yesterday, 23:42
Joined
Oct 5, 2004
Messages
147
customerID (int)
folderName (text)

i want to open the folder on_click.

i know how to open a file (by fso), but to open a folder i didn't find.

thank alot
s.
 
This will open a new session of Windows Explorer to the C:Windows\Temp\ directory...

Code:
Call Shell("C:\Windows\Explorer.exe C:\Windows\Temp", vbMaximizedFocus)
I suggest that you allow the user to browse a directory of their choice from within your application. Try the code @ API: BrowseFolder Dialog

HTH
 
great

it's work wonderfull :)

thanks

and I have another question ;)

i do an advance serch (by form)
and I want to color the word that I serch.

for example,
I search the word "go"

when I saw the result I want to color the text "go" to red
"-go-od ...", "-go-t"
in asp I did like it:
Code:
redsearch = Replace(firstsrring, "go", "<font color red>go</font>")
how can I do this in access form.

thanks again
 
Last edited:
24sharon,

You can't do that with standard Access controls. You would have to go to
a third-party add-on.

About the best that you can do in Access is:

Use the InStr function to find the search string,
Then use the .SelStart and .SelLength to highlight the search string.

This is in no way a replacement for what you need, but it could be a short
term work-around.

Wayne
 
>>>

Wayne

can you give me little example: i try do this with no success.
Code:
Private Sub myclick_Click()

Dim SearchString, SearchChar
SearchString = "XXpXXpXXPXXPabcp padd"   ' String to search in.
SearchChar = "PX"    ' Search for "PX".
For i = 1 To Len(SearchString)
 MsgBox InStr(Mid(SearchString, i, Len(SearchChar)), SearchChar)
 ' how did I highlight the search string
 
Next
End Sub
Good afternoon
From "here"
 
Sharon,

Example:

Control To Search = txtMyControl
Control With Search String = txtSearchString


Code:
Dim ptr As Long
ptr = Instr(1, Me.txtMyControl, Me.txtSearchString)
If ptr > 0 Then
   Me.txtMyControl.SelStart = ptr
   Me.txtMyControl.SelLength = Len(Me.txtSearchString)
Else
   Me.txtMyControl.SelStart  = 0
   Me.txtMyControl.SelLength = 0
End If

Wayne
 
sorry ---

its give me error

the picture is attach
 

Attachments

  • untitled.JPG
    untitled.JPG
    21 KB · Views: 121
Sharon,

What's the error?

If ptr > 0 (which it is), then the names of the controls in the
InStr function are valid.

What does the error message say?

Can you post a sample db?

Wayne
 
thanks

WayneRyan its work good. :cool:

I have to change 2 things
1.
ptr = Instr(1, Me.txtMyControl, Me.txtSearchString)
change to
ptr = Instr(1, Me.txtMyControl, Me.txtSearchString)-1

2. and to setfoucus

but its good just if you serch a string that in just once
for example if you search "abc" in "ardfabc fretdabc" its highlight just one.
and its not good for table. :o

but its very nice advice that its the first time I saw.

there is another idea that can do this.

thank you so much
s.
 

Attachments

Sharon,

More limitations.

You can't "select" or "highlight" more than one string in a control. If there
are multiple occurrences, only the first is shown.

For the same reasons, it can't work for all records displayed. You can
move the code to the form's OnCurrent event. Then when you move
to a record it will highlight ONE occurrence.

You might look at using Conditional Formatting. Maybe it can be of some
use here.

Wayne
 

Users who are viewing this thread

Back
Top Bottom