If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Continuous Forms
I Æ°ant to show all in Continuous Form by this code but I only get last record
only so anybody can help me to show all record. Thanks very much !!! Dim db As Dao.Database Dim rec As Dao.Recordset Dim strSQL As String Set db = CurrentDb() strSQL = "SELECT tblA.A, tblA.B " strSQL = strSQL & "FROM tblA " strSQL = strSQL & "WHERE tblA.DEL= " & "Yes" Set rec = db.OpenRecordset(strSQL) i = rec.RecordCount If i 0 Then rec.MoveFirst With rec Do Until rec.EOF [Forms]![frmA]![txtA] = .Fields("A") [Forms]![frmA]![txtB] = .Fields("B") rec.MoveNext Loop End With End If rec.MoveLast |
#2
|
|||
|
|||
On Fri, 19 Aug 2005 21:15:01 -0700, "A Newbie"
wrote: I ?ant to show all in Continuous Form by this code but I only get last record only so anybody can help me to show all record. Ummm... You're making something very easy into something very difficult. Simply set the Form's Recordsource property to the query. Not a single line of code is needed. John W. Vinson[MVP] |
#3
|
|||
|
|||
Change you code as follows:
Dim strSQL As String strSQL = "SELECT A, B FROM tblA WHERE DEL = Yes" me.RecordSource = strSQL -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.members.shaw.ca/AlbertKallal |
#4
|
|||
|
|||
Thanks for your reply, I already fix by " .RecordSource"
"Albert D.Kallal" wrote: Change you code as follows: Dim strSQL As String strSQL = "SELECT A, B FROM tblA WHERE DEL = Yes" me.RecordSource = strSQL -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.members.shaw.ca/AlbertKallal |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Continuous Forms | Luis | Using Forms | 5 | November 17th, 2004 12:46 AM |
Can I close all open forms? | DBS | General Discussion | 3 | October 7th, 2004 04:35 PM |
Continuous Forms - Applying different Back Colour to Text Box | SM | Using Forms | 2 | August 20th, 2004 04:04 PM |
forms in Outlook 2003 | Marty Leaf | General Discussion | 1 | August 18th, 2004 06:13 PM |
Access XP, Continuous Forms, Record position | Kyle Jedrusiak | General Discussion | 0 | June 7th, 2004 01:46 PM |