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  

Command Button in Subform Header desgined to loop through records



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2007, 04:28 PM posted to microsoft.public.access.forms
Steve
external usenet poster
 
Posts: 2,662
Default Command Button in Subform Header desgined to loop through records

I've been stumped for a many hours trying to get this to work.
I have a form(Locations) with multiple tabs. Each tab has a continuous
subform(Equipment)

I have a command button in the subform's header with the following code. I
removed all other code inside the loop. When I click this button, for some
reason only the first record in the subform gets updated.
Any help would be appreciated.

Private Sub cmdCheckConnection_Click()

Dim sRemoteMacAddress As String
Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone

With Me.Form.RecordsetClone

If .RecordCount 0 Then
.MoveFirst
Do Until .EOF
'My code that changes the MAC Address field in the record
'if it can connect to the workstation. Otherwise updates that field
'to display 'Not Connected'
.MoveNext
Loop
End If
End With
End Sub
  #2  
Old January 4th, 2007, 05:14 PM posted to microsoft.public.access.forms
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Command Button in Subform Header desgined to loop through records

hi Steve,

Steve wrote:
Private Sub cmdCheckConnection_Click()

Dim sRemoteMacAddress As String
Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone

With Me.Form.RecordsetClone

Why do you not use your recordset clone in rst?


mfG
-- stefan --
  #3  
Old January 4th, 2007, 05:23 PM posted to microsoft.public.access.forms
Steve
external usenet poster
 
Posts: 2,662
Default Command Button in Subform Header desgined to loop through reco

that was anothr bit of code I was trying to work with. The latest try was
without these 2 lines.

Dim rst As DAO.recordset
Set rst = Me.RecordsetClone

"Stefan Hoffmann" wrote:

hi Steve,

Steve wrote:
Private Sub cmdCheckConnection_Click()

Dim sRemoteMacAddress As String
Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone

With Me.Form.RecordsetClone

Why do you not use your recordset clone in rst?


mfG
-- stefan --

 




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


All times are GMT +1. The time now is 10:47 AM.


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