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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through data entry subform

Status
Not open for further replies.

GAMB1T

Programmer
May 4, 2010
3
US
Hey so my grand idea is to have a subform where the user can past in multiple account numbers and then the code will remove rows with this account number from the table.

I am having trouble setting the AccountsSubform recordset equal to what is entered into the form. This is what I have currently:

**all other declarations
Dim AccountsSubform As RecordSet

Me.SubscriptionRemovesSubform.Form.Refresh
Set AccountsSubform = Me.SubscriptionRemovesSubform.Form.RecordsetClone

With AccountsSubform
Do While Not AccountsSubform.EOF

userID = [Forms]![MainForm]![txtUserID]
AccountNumber = Me.Account_Number

problemNumber = [Forms]![RemovesForm]![problemNumber]
If (problemNumber = "") Then
problemNumber = "N/A"
End If


Set AccountsTable = CurrentDb.OpenRecordset("Accounts")

Do Until AccountsTable.EOF
If (AccountNumber = AccountsTable![AccountNumber]) Then
If (userID = AccountsTable![userID]) Then
GoTo Continue
End If
End If
AccountsTable.MoveNext
Loop

AccountsSubform.MoveNext

Loop
End With

Any help with this would be awesome!
 

Hi,

If this is MS Access, please post in one of the MS Access forums like forum702 or forum705.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top