Thank you Duane
As a matter of fact I have a version that's using bound form which is working pretty well. The reason I tried the unbound form was trying to learn more about coding techniques, sharpen my coding skills. Furthermore I don't know which method is better or more efficient than the others.
--- In MS_Access_Professionals@yahoogroups.com, Duane Hookom <duanehookom@...> wrote:
>
> Phucon,
>
> Why are you not using a bound form to display the results? It would be much much easier and accepted.
>
> Duane Hookom MVP
> MS Access
>
> ----------------------------------------
> > From: saigonf7q5@...
> >
> > I have an bound search-form which uses the following code to load records when criteria's matched. This code can only display a single record. However, when searching by ZipCode, or City, or State, the recordset normally contains more than 1 record. How do I modyfy this code so when the navigation button's clicked the records will move to the next record another
?
> >
> > strSQL = "SELECT * FROM tblTEST"
> > strSQL = strSQL & " Where " & strWhere ";"
> > Debug.Print strSQL
> > Set db = CurrentDb()
> > Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
> > If Not rs.RecordCount = 0 Then
> > rs.MoveFirst
> > rs.MoveLast
> > Me.lblRecCount.Caption = rs.RecordCount & " records found."
> > With Me
> > .txtAcctNum = rs!AcctNum
> > .txtName = rs!sName
> > .txtCity = rs!City
> > .txtState = rs!State
> > .txtZipCode = rs!ZipCode
> > End With
> >
> > Thanks a lot.
> >
> > Phucon
>
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar