pokusavam da u accessu uradim mali pretrazivac, iz exsela povlacim tabelu dve kolone,hrpa redova (brojevi, text) cilj mi je bio da na osnovu trazene rijeci pronadje red u kojem se spominje i poveze sa brojem u istom redu( razlicite kolone) gde gresim? kolone su tr- brojevi, optrbr- text,...
private Sub TRAZI_Click()
Dim optrbr As String
Dim sta1 As String
'Check STA1 for TXT value or Null Entry first.
If IsNull(Me![tr]) Or (Me![tr]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
Me![sta1].SetFocus
Exit Sub
End If
'---------------------------------------------------------------
'Performs the search using value entered into STA1
'and evaluates this against values in OPTRBR
DoCmd.ShowAllRecords
DoCmd.GoToControl ("OPTRBR")
DoCmd.FindRecord Me!optrbr
tr.SetFocus
TRREF = tr.Text
tr.SetFocus
sta1 = tr.Text
'If matching record found sets focus in optrbr and shows msgbox
'and clears search control
If optrbr = sta1 Then
MsgBox "Match Found For: " & sta1, , "Congratulations!"
tr.SetFocus
sta1 = ""
'If value not found sets focus back to sta1 and shows msgbox
Else
MsgBox "Match Not Found For: " & sta1 & " - Please Try Again.", , "Invalid Search Criterion!"
tr.SetFocus
End If
End Sub
ps. unapred zahvaljujem na pomoci

[/b]