A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Continuous Forms



 
 
Thread Tools Display Modes
  #1  
Old August 20th, 2005, 05:15 AM
A Newbie
external usenet poster
 
Posts: n/a
Default 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  
Old August 20th, 2005, 07:08 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old August 20th, 2005, 09:06 PM
Albert D.Kallal
external usenet poster
 
Posts: n/a
Default

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  
Old August 22nd, 2005, 08:35 AM
A Newbie
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.