Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

I keep getting an error on the line:
dta.Refresh
( below the line dtaCust.RecordSource = Sql )
in the following code, with a message:
"cannot jump to dtaCust because it is hidden"
Can anyone Help? Thankyou.

Private Sub cmdSearch_Click()
Dim Name As String, Sql As String
Dim Default As String, field As String
field = "[" & cboIndex.Text & "]"
Default = "Cyndi Lauper"
Name = InputBox("Search for " & field, "Search", Default)
Name = Trim(Name)
If Name = "" Then GoTo Handler
Sql = "SELECT * FROM RecordTable WHERE" & field & " = " + "" & Name + ""
dtaCust.RecordSource = Sql
dtaCust.Refresh
Exit Sub

Handler:
dtaCust.RecordSource = "SELECT * FROM RecordTable"
dtaCust.Refresh
Exit Sub
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top